Running ‘testthat.R’ [5s/6s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library("testthat")
  > library("sentimentr")
  > 
  > test_check("sentimentr")
  Saving _problems/test-extract_sentiment_terms-8.R
  Saving _problems/test-get_sentences-33.R
  Saving _problems/test-highlight-5.R
  Saving _problems/test-sentiment-10.R
  Saving _problems/test-sentiment-25.R
  Saving _problems/test-sentiment-40.R
  Saving _problems/test-sentiment-53.R
  Saving _problems/test-sentiment-68.R
  Saving _problems/test-sentiment_by-11.R
  Saving _problems/test-sentiment_by-18.R
  Saving _problems/test-sentiment_by-30.R
  Saving _problems/test-uncombine-11.R
  [ FAIL 12 | WARN 0 | SKIP 0 | PASS 16 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-extract_sentiment_terms.R:8:5'): extract_sentiment_terms extracts the terms ──
  Error in ``[.data.table`(dat, , `:=`(indx, wc < 1), by = c("id", "sentences", "wc"))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─sentimentr::extract_sentiment_terms(x) at test-extract_sentiment_terms.R:8:5
   2. └─sentimentr:::extract_sentiment_terms.get_sentences_character(x)
   3.   └─sentimentr:::make_sentence_df2(sents, retention_regex = retention_regex)
   4.     ├─dat[, `:=`(indx, wc < 1), by = c("id", "sentences", "wc")]
   5.     └─data.table:::`[.data.table`(...)
  ── Error ('test-get_sentences.R:33:5'): get_sentences works on sentment/sentiment_by ──
  Error in ``[.data.table`(dat, , `:=`(indx, wc < 1), by = c("id", "sentences", "wc"))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─sentimentr::sentiment_by(mytext, question.weight = 0) at test-get_sentences.R:33:5
   2. └─sentimentr:::sentiment_by.get_sentences_character(mytext, question.weight = 0)
   3.   ├─base::suppressWarnings(sentiment(text.var = text.var, ...))
   4.   │ └─base::withCallingHandlers(...)
   5.   ├─sentimentr::sentiment(text.var = text.var, ...)
   6.   └─sentimentr:::sentiment.get_sentences_character(...)
   7.     └─sentimentr:::make_sentence_df2(sents, retention_regex = retention_regex)
   8.       ├─dat[, `:=`(indx, wc < 1), by = c("id", "sentences", "wc")]
   9.       └─data.table:::`[.data.table`(...)
  ── Error ('test-highlight.R:5:5'): highlight produces an HTML file ─────────────
  Error in ``[.data.table`(dat, , `:=`(indx, wc < 1), by = c("id", "sentences", "wc"))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─sentimentr::sentiment_by(...) at test-highlight.R:5:5
   2. └─sentimentr:::sentiment_by.get_sentences_character(...)
   3.   ├─base::suppressWarnings(sentiment(text.var = text.var, ...))
   4.   │ └─base::withCallingHandlers(...)
   5.   ├─sentimentr::sentiment(text.var = text.var, ...)
   6.   └─sentimentr:::sentiment.get_sentences_character(...)
   7.     └─sentimentr:::make_sentence_df2(sents, retention_regex = retention_regex)
   8.       ├─dat[, `:=`(indx, wc < 1), by = c("id", "sentences", "wc")]
   9.       └─data.table:::`[.data.table`(...)
  ── Error ('test-sentiment.R:10:5'): sentiment produces a data.table with numeric sentiment column ──
  Error in ``[.data.table`(dat, , `:=`(indx, wc < 1), by = c("id", "sentences", "wc"))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─testthat::expect_true(is(sentiment(mytext), "data.table")) at test-sentiment.R:10:5
   2. │ └─testthat::quasi_label(enquo(object), label)
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. ├─methods::is(sentiment(mytext), "data.table")
   5. ├─sentimentr::sentiment(mytext)
   6. └─sentimentr:::sentiment.get_sentences_character(mytext)
   7.   └─sentimentr:::make_sentence_df2(sents, retention_regex = retention_regex)
   8.     ├─dat[, `:=`(indx, wc < 1), by = c("id", "sentences", "wc")]
   9.     └─data.table:::`[.data.table`(...)
  ── Error ('test-sentiment.R:25:5'): sentiment question.weight = 0 alters the output ──
  Error in ``[.data.table`(dat, , `:=`(indx, wc < 1), by = c("id", "sentences", "wc"))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─sentimentr::sentiment(mytext) at test-sentiment.R:25:5
   2. └─sentimentr:::sentiment.get_sentences_character(mytext)
   3.   └─sentimentr:::make_sentence_df2(sents, retention_regex = retention_regex)
   4.     ├─dat[, `:=`(indx, wc < 1), by = c("id", "sentences", "wc")]
   5.     └─data.table:::`[.data.table`(...)
  ── Error ('test-sentiment.R:40:5'): sentiment n.before/n.after alters the output ──
  Error in ``[.data.table`(dat, , `:=`(indx, wc < 1), by = c("id", "sentences", "wc"))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─sentimentr::sentiment(mytext) at test-sentiment.R:40:5
   2. └─sentimentr:::sentiment.get_sentences_character(mytext)
   3.   └─sentimentr:::make_sentence_df2(sents, retention_regex = retention_regex)
   4.     ├─dat[, `:=`(indx, wc < 1), by = c("id", "sentences", "wc")]
   5.     └─data.table:::`[.data.table`(...)
  ── Error ('test-sentiment.R:53:5'): sentiment adversative.weight = 0 alters the output ──
  Error in ``[.data.table`(dat, , `:=`(indx, wc < 1), by = c("id", "sentences", "wc"))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─sentimentr::sentiment(mytext) at test-sentiment.R:53:5
   2. └─sentimentr:::sentiment.get_sentences_character(mytext)
   3.   └─sentimentr:::make_sentence_df2(sents, retention_regex = retention_regex)
   4.     ├─dat[, `:=`(indx, wc < 1), by = c("id", "sentences", "wc")]
   5.     └─data.table:::`[.data.table`(...)
  ── Error ('test-sentiment.R:68:5'): sentiment_by plots a ggplot object ─────────
  Error in ``[.data.table`(dat, , `:=`(indx, wc < 1), by = c("id", "sentences", "wc"))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
       ▆
    1. ├─testthat::expect_true(is(plot(sentiment(mytext)), "ggplot")) at test-sentiment.R:68:5
    2. │ └─testthat::quasi_label(enquo(object), label)
    3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
    4. ├─methods::is(plot(sentiment(mytext)), "ggplot")
    5. ├─base::plot(sentiment(mytext))
    6. ├─sentimentr::sentiment(mytext)
    7. └─sentimentr:::sentiment.get_sentences_character(mytext)
    8.   └─sentimentr:::make_sentence_df2(sents, retention_regex = retention_regex)
    9.     ├─dat[, `:=`(indx, wc < 1), by = c("id", "sentences", "wc")]
   10.     └─data.table:::`[.data.table`(...)
  ── Error ('test-sentiment_by.R:11:5'): sentiment_by gives combined elements when `by = NULL` ──
  Error in ``[.data.table`(dat, , `:=`(indx, wc < 1), by = c("id", "sentences", "wc"))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
       ▆
    1. ├─testthat::expect_true(is(sentiment_by(mytext), "data.table")) at test-sentiment_by.R:11:5
    2. │ └─testthat::quasi_label(enquo(object), label)
    3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
    4. ├─methods::is(sentiment_by(mytext), "data.table")
    5. ├─sentimentr::sentiment_by(mytext)
    6. └─sentimentr:::sentiment_by.get_sentences_character(mytext)
    7.   ├─base::suppressWarnings(sentiment(text.var = text.var, ...))
    8.   │ └─base::withCallingHandlers(...)
    9.   ├─sentimentr::sentiment(text.var = text.var, ...)
   10.   └─sentimentr:::sentiment.get_sentences_character(...)
   11.     └─sentimentr:::make_sentence_df2(sents, retention_regex = retention_regex)
   12.       ├─dat[, `:=`(indx, wc < 1), by = c("id", "sentences", "wc")]
   13.       └─data.table:::`[.data.table`(...)
  ── Error ('test-sentiment_by.R:18:5'): sentiment_by gives combined group when `by` is given ──
  Error in ``[.data.table`(dat, , `:=`(indx, wc < 1), by = c("id", "sentences", "wc"))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
       ▆
    1. ├─base::with(...) at test-sentiment_by.R:18:5
    2. └─base::with.default(...)
    3.   └─base::eval(substitute(expr), data, enclos = parent.frame())
    4.     └─base::eval(substitute(expr), data, enclos = parent.frame())
    5.       ├─sentimentr::sentiment_by(...)
    6.       └─sentimentr:::sentiment_by.get_sentences_character(...)
    7.         ├─base::suppressWarnings(sentiment(text.var = text.var, ...))
    8.         │ └─base::withCallingHandlers(...)
    9.         ├─sentimentr::sentiment(text.var = text.var, ...)
   10.         └─sentimentr:::sentiment.get_sentences_character(...)
   11.           └─sentimentr:::make_sentence_df2(sents, retention_regex = retention_regex)
   12.             ├─dat[, `:=`(indx, wc < 1), by = c("id", "sentences", "wc")]
   13.             └─data.table:::`[.data.table`(...)
  ── Error ('test-sentiment_by.R:30:5'): sentiment_by plots a ggplot object ──────
  Error in ``[.data.table`(dat, , `:=`(indx, wc < 1), by = c("id", "sentences", "wc"))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
       ▆
    1. ├─testthat::expect_true(is(plot(sentiment_by(mytext)), "ggplot")) at test-sentiment_by.R:30:5
    2. │ └─testthat::quasi_label(enquo(object), label)
    3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
    4. ├─methods::is(plot(sentiment_by(mytext)), "ggplot")
    5. ├─base::plot(sentiment_by(mytext))
    6. ├─sentimentr::sentiment_by(mytext)
    7. └─sentimentr:::sentiment_by.get_sentences_character(mytext)
    8.   ├─base::suppressWarnings(sentiment(text.var = text.var, ...))
    9.   │ └─base::withCallingHandlers(...)
   10.   ├─sentimentr::sentiment(text.var = text.var, ...)
   11.   └─sentimentr:::sentiment.get_sentences_character(...)
   12.     └─sentimentr:::make_sentence_df2(sents, retention_regex = retention_regex)
   13.       ├─dat[, `:=`(indx, wc < 1), by = c("id", "sentences", "wc")]
   14.       └─data.table:::`[.data.table`(...)
  ── Error ('test-uncombine.R:11:5'): uncombine ... ──────────────────────────────
  Error in ``[.data.table`(dat, , `:=`(indx, wc < 1), by = c("id", "sentences", "wc"))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─sentimentr::sentiment_by(mytext) at test-uncombine.R:11:5
   2. └─sentimentr:::sentiment_by.get_sentences_character(mytext)
   3.   ├─base::suppressWarnings(sentiment(text.var = text.var, ...))
   4.   │ └─base::withCallingHandlers(...)
   5.   ├─sentimentr::sentiment(text.var = text.var, ...)
   6.   └─sentimentr:::sentiment.get_sentences_character(...)
   7.     └─sentimentr:::make_sentence_df2(sents, retention_regex = retention_regex)
   8.       ├─dat[, `:=`(indx, wc < 1), by = c("id", "sentences", "wc")]
   9.       └─data.table:::`[.data.table`(...)
  
  [ FAIL 12 | WARN 0 | SKIP 0 | PASS 16 ]
  Error:
  ! Test failures.
  Execution halted