Running ‘testthat.R’ [5s/8s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(SentimentAnalysis)
  
  Attaching package: 'SentimentAnalysis'
  
  The following object is masked from 'package:base':
  
      write
  
  > 
  > test_check("SentimentAnalysis")
  Comparing: wordlist vs wordlist
  
  Total unique words: 5
  Matching entries: 1 (0.2%)
  Comparing: binary vs binary
  
  Total unique words: 10
  Matching entries: 3 (0.3%)
  Entries with same classification: 2 (0.2%)
  Entries with different classification: 1 (0.1%)
  Comparing: weighted vs weighted
  
  Total unique words: 10
  Matching entries: 3 (0.3%)
  Entries with same classification: 2 (0.2%)
  Entries with different classification: 1 (0.1%)
  Correlation between scores of matching entries: 0.5
  Average sentiment: 0.25 vs -0.4
  ── ERROR (test.analyzeSentiment.R:28:3): sentiment analysis works with custom ru
  Error: length(class) == 1L is not TRUE
  Backtrace:
      █
   1. ├─SentimentAnalysis::analyzeSentiment(...) test.analyzeSentiment.R:28:2
   2. └─SentimentAnalysis:::analyzeSentiment.character(...)
   3.   └─SentimentAnalysis::transformIntoCorpus(x)
   4.     └─tm::VCorpus(tm::VectorSource(x))
   5.       └─utils::getS3method("pGetElem", class(x), TRUE)
   6.         └─base::stopifnot(is.character(class), length(class) == 1L)
  
  ── ERROR (test.analyzeSentiment.R:204:3): word counting works correctly ────────
  Error: length(class) == 1L is not TRUE
  Backtrace:
      █
   1. ├─SentimentAnalysis::analyzeSentiment(documents, rules = list(WordCount = list(ruleWordCount))) test.analyzeSentiment.R:204:2
   2. └─SentimentAnalysis:::analyzeSentiment.character(documents, rules = list(WordCount = list(ruleWordCount)))
   3.   └─SentimentAnalysis::transformIntoCorpus(x)
   4.     └─tm::VCorpus(tm::VectorSource(x))
   5.       └─utils::getS3method("pGetElem", class(x), TRUE)
   6.         └─base::stopifnot(is.character(class), length(class) == 1L)
  
  ── ERROR (test.analyzeSentiment.R:224:3): foreign langauge without stemming work
  Error: length(class) == 1L is not TRUE
  Backtrace:
      █
   1. ├─SentimentAnalysis::analyzeSentiment(...) test.analyzeSentiment.R:224:2
   2. └─SentimentAnalysis:::analyzeSentiment.character(...)
   3.   └─SentimentAnalysis::transformIntoCorpus(x)
   4.     └─tm::VCorpus(tm::VectorSource(x))
   5.       └─utils::getS3method("pGetElem", class(x), TRUE)
   6.         └─base::stopifnot(is.character(class), length(class) == 1L)
  
  ── ERROR (test.countWords.R:5:3): word counting works correctly ────────────────
  Error: length(class) == 1L is not TRUE
  Backtrace:
      █
   1. ├─SentimentAnalysis::countWords(documents) test.countWords.R:5:2
   2. └─SentimentAnalysis:::countWords.character(documents)
   3.   └─SentimentAnalysis::transformIntoCorpus(x)
   4.     └─tm::VCorpus(tm::VectorSource(x))
   5.       └─utils::getS3method("pGetElem", class(x), TRUE)
   6.         └─base::stopifnot(is.character(class), length(class) == 1L)
  
  ── ERROR (test.generateDictionary.R:19:3): dictionary generations works correctl
  Error: length(class) == 1L is not TRUE
  Backtrace:
      █
   1. ├─SentimentAnalysis::generateDictionary(documents, response) test.generateDictionary.R:19:2
   2. └─SentimentAnalysis:::generateDictionary.character(documents, response)
   3.   └─SentimentAnalysis::transformIntoCorpus(x)
   4.     └─tm::VCorpus(tm::VectorSource(x))
   5.       └─utils::getS3method("pGetElem", class(x), TRUE)
   6.         └─base::stopifnot(is.character(class), length(class) == 1L)
  
  ── ERROR (test.ngrams.R:6:3): character n-grams are generated correctly ────────
  Error: length(class) == 1L is not TRUE
  Backtrace:
      █
   1. └─tm::VCorpus(VectorSource(en)) test.ngrams.R:6:2
   2.   └─utils::getS3method("pGetElem", class(x), TRUE)
   3.     └─base::stopifnot(is.character(class), length(class) == 1L)
  
  ── ERROR (test.ngrams.R:20:3): word n-grams are generated correctly ────────────
  Error: length(class) == 1L is not TRUE
  Backtrace:
      █
   1. └─tm::VCorpus(VectorSource(en)) test.ngrams.R:20:2
   2.   └─utils::getS3method("pGetElem", class(x), TRUE)
   3.     └─base::stopifnot(is.character(class), length(class) == 1L)
  
  ── ERROR (test.predict.R:18:3): SentimentDictionaryWeighted is predicted correct
  Error: length(class) == 1L is not TRUE
  Backtrace:
      █
   1. ├─stats::predict(dictionary, documents, weighting = function(x) tm::weightTf(x)) test.predict.R:18:2
   2. └─SentimentAnalysis:::predict.SentimentDictionaryWeighted(...)
   3.   ├─SentimentAnalysis:::predictWeighted(...)
   4.   └─SentimentAnalysis:::predictWeighted.character(...)
   5.     └─SentimentAnalysis::transformIntoCorpus(x, ...)
   6.       └─tm::VCorpus(tm::VectorSource(x))
   7.         └─utils::getS3method("pGetElem", class(x), TRUE)
   8.           └─base::stopifnot(is.character(class), length(class) == 1L)
  
  ── ERROR (test.preprocessCorpus.R:11:3): function only accepts valid values as l
  Error: length(class) == 1L is not TRUE
  Backtrace:
      █
   1. └─SentimentAnalysis::transformIntoCorpus(c("a", "b", "c")) test.preprocessCorpus.R:11:2
   2.   └─tm::VCorpus(tm::VectorSource(x))
   3.     └─utils::getS3method("pGetElem", class(x), TRUE)
   4.       └─base::stopifnot(is.character(class), length(class) == 1L)
  
  ── ERROR (test.preprocessCorpus.R:23:3): function only accepts valid values as s
  Error: length(class) == 1L is not TRUE
  Backtrace:
      █
   1. └─SentimentAnalysis::transformIntoCorpus(c("a", "b", "c")) test.preprocessCorpus.R:23:2
   2.   └─tm::VCorpus(tm::VectorSource(x))
   3.     └─utils::getS3method("pGetElem", class(x), TRUE)
   4.       └─base::stopifnot(is.character(class), length(class) == 1L)
  
  ── ERROR (test.preprocessCorpus.R:31:3): function only accepts valid values as v
  Error: length(class) == 1L is not TRUE
  Backtrace:
      █
   1. └─SentimentAnalysis::transformIntoCorpus(c("a", "b", "c")) test.preprocessCorpus.R:31:2
   2.   └─tm::VCorpus(tm::VectorSource(x))
   3.     └─utils::getS3method("pGetElem", class(x), TRUE)
   4.       └─base::stopifnot(is.character(class), length(class) == 1L)
  
  ── ERROR (test.transformIntoCorpus.R:13:3): function transforms character into c
  Error: length(class) == 1L is not TRUE
  Backtrace:
      █
   1. └─SentimentAnalysis::transformIntoCorpus(character(0)) test.transformIntoCorpus.R:13:2
   2.   └─tm::VCorpus(tm::VectorSource(x))
   3.     └─utils::getS3method("pGetElem", class(x), TRUE)
   4.       └─base::stopifnot(is.character(class), length(class) == 1L)
  
  ── ERROR (test.transformIntoCorpus.R:36:3): function transforms list into correc
  Error: length(class) == 1L is not TRUE
  Backtrace:
      █
   1. └─SentimentAnalysis::transformIntoCorpus(list()) test.transformIntoCorpus.R:36:2
   2.   └─tm::VCorpus(tm::VectorSource(x))
   3.     └─utils::getS3method("pGetElem", class(x), TRUE)
   4.       └─base::stopifnot(is.character(class), length(class) == 1L)
  
  ── ERROR (test.transformIntoCorpus.R:71:3): function transforms data.frame (with
  Error: length(class) == 1L is not TRUE
  Backtrace:
      █
   1. └─SentimentAnalysis::transformIntoCorpus(data.frame()) test.transformIntoCorpus.R:71:2
   2.   └─tm::VCorpus(tm::VectorSource(x))
   3.     └─utils::getS3method("pGetElem", class(x), TRUE)
   4.       └─base::stopifnot(is.character(class), length(class) == 1L)
  
  ── ERROR (test.transformIntoCorpus.R:112:3): function transforms data.frame (wit
  Error: length(class) == 1L is not TRUE
  Backtrace:
      █
   1. └─SentimentAnalysis::transformIntoCorpus(data.frame()) test.transformIntoCorpus.R:112:2
   2.   └─tm::VCorpus(tm::VectorSource(x))
   3.     └─utils::getS3method("pGetElem", class(x), TRUE)
   4.       └─base::stopifnot(is.character(class), length(class) == 1L)
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  ERROR (test.analyzeSentiment.R:28:3): sentiment analysis works with custom rules
  ERROR (test.analyzeSentiment.R:204:3): word counting works correctly
  ERROR (test.analyzeSentiment.R:224:3): foreign langauge without stemming works correctly
  ERROR (test.countWords.R:5:3): word counting works correctly
  ERROR (test.generateDictionary.R:19:3): dictionary generations works correctly
  ERROR (test.ngrams.R:6:3): character n-grams are generated correctly
  ERROR (test.ngrams.R:20:3): word n-grams are generated correctly
  ERROR (test.predict.R:18:3): SentimentDictionaryWeighted is predicted correctly
  ERROR (test.preprocessCorpus.R:11:3): function only accepts valid values as language
  ERROR (test.preprocessCorpus.R:23:3): function only accepts valid values as stemming
  ERROR (test.preprocessCorpus.R:31:3): function only accepts valid values as verbose
  ERROR (test.transformIntoCorpus.R:13:3): function transforms character into correct corpus
  ERROR (test.transformIntoCorpus.R:36:3): function transforms list into correct corpus
  ERROR (test.transformIntoCorpus.R:71:3): function transforms data.frame (without factors) into correct corpus
  ERROR (test.transformIntoCorpus.R:112:3): function transforms data.frame (with factors) into correct corpus
  
  [ FAIL 15 | WARN 0 | SKIP 0 | PASS 228 ]
  Error: Test failures
  Execution halted