Running ‘testthat.R’ [6s/9s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library("testthat")
  > library("sentimentr")
  > 
  > test_check("sentimentr")
  ── 1. Error: extract_sentiment_terms extracts the terms (@test-extract_sentiment
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: extract_sentiment_terms(x) at testthat/test-extract_sentiment_terms.R:7
  2: extract_sentiment_terms.get_sentences_character(x)
  3: sent_dat[, `:=`(sentence_id, seq_len(.N)), by = "id"]
  4: `[.data.table`(sent_dat, , `:=`(sentence_id, seq_len(.N)), by = "id")
  
  ── 2. Error: get_sentences works on sentment/sentiment_by (@test-get_sentences.R
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: sentiment_by(mytext, question.weight = 0) at testthat/test-get_sentences.R:33
  2: sentiment_by.get_sentences_character(mytext, question.weight = 0)
  3: suppressWarnings(sentiment(text.var = text.var, ...))
  4: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
  5: sentiment(text.var = text.var, ...)
  6: sentiment.get_sentences_character(text.var = text.var, ...)
  7: sent_dat[, `:=`(id2, seq_len(.N)), by = "id"]
  8: `[.data.table`(sent_dat, , `:=`(id2, seq_len(.N)), by = "id")
  
  ── 3. Error: highlight produces an HTML file (@test-highlight.R#5)  ────────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: sentiment_by(get_sentences(gsub("Sam-I-am", "Sam I am", sam_i_am))) at testthat/test-highlight.R:5
  2: sentiment_by.get_sentences_character(get_sentences(gsub("Sam-I-am", "Sam I am", sam_i_am)))
  3: suppressWarnings(sentiment(text.var = text.var, ...))
  4: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
  5: sentiment(text.var = text.var, ...)
  6: sentiment.get_sentences_character(text.var = text.var, ...)
  7: make_sentence_df2(sents)
  8: dat[, `:=`(indx, wc < 1), by = c("id", "sentences", "wc")]
  9: `[.data.table`(dat, , `:=`(indx, wc < 1), by = c("id", "sentences", "wc"))
  
  ── 4. Error: sentiment produces a data.table with numeric sentiment column (@tes
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: expect_true(is(sentiment(mytext), "data.table")) at testthat/test-sentiment.R:10
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: is(sentiment(mytext), "data.table")
  5: sentiment(mytext)
  6: sentiment.get_sentences_character(mytext)
  7: sent_dat[, `:=`(id2, seq_len(.N)), by = "id"]
  8: `[.data.table`(sent_dat, , `:=`(id2, seq_len(.N)), by = "id")
  
  ── 5. Error: sentiment question.weight = 0 alters the output (@test-sentiment.R#
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: sentiment(mytext) at testthat/test-sentiment.R:25
  2: sentiment.get_sentences_character(mytext)
  3: sent_dat[, `:=`(id2, seq_len(.N)), by = "id"]
  4: `[.data.table`(sent_dat, , `:=`(id2, seq_len(.N)), by = "id")
  
  ── 6. Error: sentiment n.before/n.after alters the output (@test-sentiment.R#40)
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: sentiment(mytext) at testthat/test-sentiment.R:40
  2: sentiment.get_sentences_character(mytext)
  3: sent_dat[, `:=`(id2, seq_len(.N)), by = "id"]
  4: `[.data.table`(sent_dat, , `:=`(id2, seq_len(.N)), by = "id")
  
  ── 7. Error: sentiment adversative.weight = 0 alters the output (@test-sentiment
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: sentiment(mytext) at testthat/test-sentiment.R:53
  2: sentiment.get_sentences_character(mytext)
  3: sent_dat[, `:=`(id2, seq_len(.N)), by = "id"]
  4: `[.data.table`(sent_dat, , `:=`(id2, seq_len(.N)), by = "id")
  
  ── 8. Error: sentiment_by plots a ggplot object (@test-sentiment.R#68)  ────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: expect_true(is(plot(sentiment(mytext)), "ggplot")) at testthat/test-sentiment.R:68
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: is(plot(sentiment(mytext)), "ggplot")
  5: plot(sentiment(mytext))
  6: sentiment(mytext)
  7: sentiment.get_sentences_character(mytext)
  8: sent_dat[, `:=`(id2, seq_len(.N)), by = "id"]
  9: `[.data.table`(sent_dat, , `:=`(id2, seq_len(.N)), by = "id")
  
  ── 9. Error: sentiment_by gives combined elements when `by = NULL` (@test-sentim
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: expect_true(is(sentiment_by(mytext), "data.table")) at testthat/test-sentiment_by.R:11
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: is(sentiment_by(mytext), "data.table")
  5: sentiment_by(mytext)
  6: sentiment_by.get_sentences_character(mytext)
  7: suppressWarnings(sentiment(text.var = text.var, ...))
  8: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
  9: sentiment(text.var = text.var, ...)
  10: sentiment.get_sentences_character(text.var = text.var, ...)
  11: sent_dat[, `:=`(id2, seq_len(.N)), by = "id"]
  12: `[.data.table`(sent_dat, , `:=`(id2, seq_len(.N)), by = "id")
  
  ── 10. Error: sentiment_by gives combined group when `by` is given (@test-sentim
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: with(presidential_debates_2012, sentiment_by(get_sentences(dialogue), list(person, 
         time))) at testthat/test-sentiment_by.R:18
  2: with.default(presidential_debates_2012, sentiment_by(get_sentences(dialogue), list(person, 
         time)))
  3: eval(substitute(expr), data, enclos = parent.frame())
  4: eval(substitute(expr), data, enclos = parent.frame())
  5: sentiment_by(get_sentences(dialogue), list(person, time))
  6: sentiment_by.get_sentences_character(get_sentences(dialogue), list(person, time))
  7: suppressWarnings(sentiment(text.var = text.var, ...))
  8: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
  9: sentiment(text.var = text.var, ...)
  10: sentiment.get_sentences_character(text.var = text.var, ...)
  11: word_dat[, `:=`(pol_loc, seq_len(.N)), by = c("id", "id2")]
  12: `[.data.table`(word_dat, , `:=`(pol_loc, seq_len(.N)), by = c("id", "id2"))
  
  ── 11. Error: sentiment_by plots a ggplot object (@test-sentiment_by.R#30)  ────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: expect_true(is(plot(sentiment_by(mytext)), "ggplot")) at testthat/test-sentiment_by.R:30
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: is(plot(sentiment_by(mytext)), "ggplot")
  5: plot(sentiment_by(mytext))
  6: sentiment_by(mytext)
  7: sentiment_by.get_sentences_character(mytext)
  8: suppressWarnings(sentiment(text.var = text.var, ...))
  9: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
  10: sentiment(text.var = text.var, ...)
  11: sentiment.get_sentences_character(text.var = text.var, ...)
  12: sent_dat[, `:=`(id2, seq_len(.N)), by = "id"]
  13: `[.data.table`(sent_dat, , `:=`(id2, seq_len(.N)), by = "id")
  
  ── 12. Error: uncombine ... (@test-uncombine.R#11)  ────────────────────────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: sentiment_by(mytext) at testthat/test-uncombine.R:11
  2: sentiment_by.get_sentences_character(mytext)
  3: suppressWarnings(sentiment(text.var = text.var, ...))
  4: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
  5: sentiment(text.var = text.var, ...)
  6: sentiment.get_sentences_character(text.var = text.var, ...)
  7: sent_dat[, `:=`(id2, seq_len(.N)), by = "id"]
  8: `[.data.table`(sent_dat, , `:=`(id2, seq_len(.N)), by = "id")
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 16 SKIPPED: 0 FAILED: 12
  1. Error: extract_sentiment_terms extracts the terms (@test-extract_sentiment_terms.R#7) 
  2. Error: get_sentences works on sentment/sentiment_by (@test-get_sentences.R#33) 
  3. Error: highlight produces an HTML file (@test-highlight.R#5) 
  4. Error: sentiment produces a data.table with numeric sentiment column (@test-sentiment.R#10) 
  5. Error: sentiment question.weight = 0 alters the output (@test-sentiment.R#25) 
  6. Error: sentiment n.before/n.after alters the output (@test-sentiment.R#40) 
  7. Error: sentiment adversative.weight = 0 alters the output (@test-sentiment.R#53) 
  8. Error: sentiment_by plots a ggplot object (@test-sentiment.R#68) 
  9. Error: sentiment_by gives combined elements when `by = NULL` (@test-sentiment_by.R#11) 
  1. ...
  
  Error: testthat unit tests failed
  Execution halted