- using R Under development (unstable) (2025-12-22 r89219)
- using platform: x86_64-pc-linux-gnu
- R was compiled by
gcc-15 (Debian 15.2.0-11) 15.2.0
GNU Fortran (Debian 15.2.0-11) 15.2.0
- running under: Debian GNU/Linux forky/sid
- using session charset: UTF-8
- checking for file ‘sentimentr/DESCRIPTION’ ... OK
- this is package ‘sentimentr’ version ‘2.9.0’
- package encoding: UTF-8
- checking CRAN incoming feasibility ... [1s/2s] NOTE
Maintainer: ‘Tyler Rinker <tyler.rinker@gmail.com>’
Package CITATION file contains call(s) to old-style citEntry(). Please
use bibentry() instead.
- checking package namespace information ... OK
- checking package dependencies ... OK
- checking if this is a source package ... OK
- checking if there is a namespace ... OK
- checking for executable files ... OK
- checking for hidden files and directories ... OK
- checking for portable file names ... OK
- checking for sufficient/correct file permissions ... OK
- checking serialization versions ... OK
- checking whether package ‘sentimentr’ can be installed ... OK
See the install log for details.
- checking package directory ... OK
- checking for future file timestamps ... OK
- checking DESCRIPTION meta-information ... OK
- checking top-level files ... OK
- checking for left-over files ... OK
- checking index information ... OK
- checking package subdirectories ... OK
- checking code files for non-ASCII characters ... OK
- checking R files for syntax errors ... OK
- checking whether the package can be loaded ... [1s/1s] OK
- checking whether the package can be loaded with stated dependencies ... [0s/1s] OK
- checking whether the package can be unloaded cleanly ... [0s/0s] OK
- checking whether the namespace can be loaded with stated dependencies ... [0s/1s] OK
- checking whether the namespace can be unloaded cleanly ... [0s/1s] OK
- checking loading without being on the library search path ... [0s/1s] OK
- checking use of S3 registration ... OK
- checking dependencies in R code ... OK
- checking S3 generic/method consistency ... OK
- checking replacement functions ... OK
- checking foreign function calls ... OK
- checking R code for possible problems ... [8s/9s] OK
- checking Rd files ... [0s/0s] OK
- checking Rd metadata ... OK
- checking Rd line widths ... OK
- checking Rd cross-references ... OK
- checking for missing documentation entries ... OK
- checking for code/documentation mismatches ... OK
- checking Rd \usage sections ... OK
- checking Rd contents ... OK
- checking for unstated dependencies in examples ... OK
- checking contents of ‘data’ directory ... OK
- checking data for non-ASCII characters ... [1s/2s] OK
- checking LazyData ... OK
- checking data for ASCII and uncompressed saves ... OK
- checking examples ... [1s/1s] ERROR
Running examples in ‘sentimentr-Ex.R’ failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: emotion
> ### Title: Compute Emotion Rate
> ### Aliases: emotion
>
> ### ** Examples
>
> mytext <- c(
+ "I am not afraid of you",
+ NA,
+ "",
+ "I love it [not really]",
+ "I'm not angry with you",
+ "I hate it when you lie to me. It's so humiliating",
+ "I'm not happpy anymore. It's time to end it",
+ "She's a darn good friend to me",
+ "I went to the terrible store",
+ "There is hate and love in each of us",
+ "I'm no longer angry! I'm really experiencing peace but not true joy.",
+
+ paste("Out of the night that covers me, Black as the Pit from pole to",
+ "pole, I thank whatever gods may be For my unconquerable soul."
+ ),
+ paste("In the fell clutch of circumstance I have not winced nor cried",
+ "aloud. Under the bludgeonings of chance My head is bloody, but unbowed."
+ ),
+ paste("Beyond this place of wrath and tears Looms but the Horror of the",
+ "shade, And yet the menace of the years Finds, and shall find, me unafraid."
+ ),
+ paste("It matters not how strait the gate, How charged with punishments",
+ "the scroll, I am the master of my fate: I am the captain of my soul."
+ )
+
+ )
>
> ## works on a character vector but not the preferred method avoiding the
> ## repeated cost of doing sentence boundary disambiguation every time
> ## `emotion` is run
> emotion(mytext)
Error in `[.data.table`(tidied[, list(token = stringi::stri_replace_all_regex(unlist(token), :
attempt access index 4/4 in VECTOR_ELT
Calls: emotion ... emotion.get_sentences_character -> [ -> [.data.table
Execution halted
- checking for unstated dependencies in ‘tests’ ... OK
- checking tests ... [3s/5s] ERROR
Running ‘testthat.R’ [3s/4s]
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
- checking PDF version of manual ... [6s/8s] OK
- checking HTML version of manual ... [3s/5s] OK
- checking for non-standard things in the check directory ... OK
- DONE
Status: 2 ERRORs, 1 NOTE