Running ‘testthat.R’ [3s/6s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > Sys.setenv("R_TESTS" = "")
  > library(testthat)
  > library(text2vec)
  > library(mlapi)
  > data("movie_review")
  > test_check("text2vec")
  ── 1. Error: (unknown) (@test-colloc.R#12)  ────────────────────────────────────
  not a function
  1: system.time(v <- create_vocabulary(it)) at testthat/test-colloc.R:12
  2: create_vocabulary(it)
  3: create_vocabulary.itoken(it)
  4: it$clone(deep = TRUE)
  5: copy_slice(old[[i]], new[[i]], old_new_enclosing_pairs[seq.int(i, length(old))], 
         (i == 1))
  6: makeActiveBinding(name, active_copies[[name]], new_slice$binding)
  
  ── 2. Error: (unknown) (@test-distances.R#11)  ─────────────────────────────────
  not a function
  1: create_vocabulary(it) at testthat/test-distances.R:11
  2: create_vocabulary.itoken(it)
  3: it$clone(deep = TRUE)
  4: copy_slice(old[[i]], new[[i]], old_new_enclosing_pairs[seq.int(i, length(old))], 
         (i == 1))
  5: makeActiveBinding(name, active_copies[[name]], new_slice$binding)
  
  ── 3. Error: Unigram Hash Corpus construction (@test-hash-corpus.R#15)  ────────
  not a function
  1: create_dtm(it, vectorizer) at testthat/test-hash-corpus.R:15
  2: create_dtm.itoken(it, vectorizer)
  3: vectorizer(it, grow_dtm = TRUE, skip_grams_window_context = "symmetric", window_size = 0, 
         weights = numeric(0))
  4: corpus_insert(hash_corpus_ptr, iterator, grow_dtm, skip_grams_window_context, window_size, 
         weights)
  5: iterator$clone(deep = TRUE)
  6: copy_slice(old[[i]], new[[i]], old_new_enclosing_pairs[seq.int(i, length(old))], 
         (i == 1))
  7: makeActiveBinding(name, active_copies[[name]], new_slice$binding)
  
  ── 4. Error: trigram hash-corpus construction (@test-hash-corpus.R#33)  ────────
  not a function
  1: create_dtm(it, vectorizer) at testthat/test-hash-corpus.R:33
  2: create_dtm.itoken(it, vectorizer)
  3: vectorizer(it, grow_dtm = TRUE, skip_grams_window_context = "symmetric", window_size = 0, 
         weights = numeric(0))
  4: corpus_insert(hash_corpus_ptr, iterator, grow_dtm, skip_grams_window_context, window_size, 
         weights)
  5: iterator$clone(deep = TRUE)
  6: copy_slice(old[[i]], new[[i]], old_new_enclosing_pairs[seq.int(i, length(old))], 
         (i == 1))
  7: makeActiveBinding(name, active_copies[[name]], new_slice$binding)
  
  ── 5. Error: ifiles (@test-iterators.R#23)  ────────────────────────────────────
  not a function
  1: itoken(it, preprocessor = tolower, tokenizer = word_tokenizer, progressbar = FALSE) at testthat/test-iterators.R:23
  2: itoken.iterator(it, preprocessor = tolower, tokenizer = word_tokenizer, progressbar = FALSE)
  3: iterable$clone()
  4: copy_slice(old[[i]], new[[i]], old_new_enclosing_pairs[seq.int(i, length(old))], 
         (i == 1))
  5: makeActiveBinding(name, active_copies[[name]], new_slice$binding)
  
  ── 6. Error: ifiles_parallel (@test-iterators.R#36)  ───────────────────────────
  not a function
  1: itoken_parallel(it, preprocessor = tolower, tokenizer = word_tokenizer, progressbar = FALSE) at testthat/test-iterators.R:36
  2: itoken_parallel.ifiles_parallel(it, preprocessor = tolower, tokenizer = word_tokenizer, 
         progressbar = FALSE)
  3: lapply(iterable, function(it_files) {
         itoken(it_files, preprocessor = preprocessor, tokenizer = tokenizer, n_chunks = n_chunks, 
             ...)
     })
  4: FUN(X[[i]], ...)
  5: itoken(it_files, preprocessor = preprocessor, tokenizer = tokenizer, n_chunks = n_chunks, 
         ...)
  6: itoken.iterator(it_files, preprocessor = preprocessor, tokenizer = tokenizer, n_chunks = n_chunks, 
         ...)
  7: iterable$clone()
  8: copy_slice(old[[i]], new[[i]], old_new_enclosing_pairs[seq.int(i, length(old))], 
         (i == 1))
  9: makeActiveBinding(name, active_copies[[name]], new_slice$binding)
  
  ── 7. Error: itoken character (@test-iterators.R#59)  ──────────────────────────
  not a function
  1: create_vocabulary(it2) at testthat/test-iterators.R:59
  2: create_vocabulary.itoken(it2)
  3: it$clone(deep = TRUE)
  4: copy_slice(old[[i]], new[[i]], old_new_enclosing_pairs[seq.int(i, length(old))], 
         (i == 1))
  5: makeActiveBinding(name, active_copies[[name]], new_slice$binding)
  
  ── 8. Error: itoken character parallel (@test-iterators.R#65)  ─────────────────
  task 1 failed - "not a function"
  1: create_vocabulary(it2) at testthat/test-iterators.R:65
  2: create_vocabulary.itoken_parallel(it2)
  3: foreach(it = it, .combine = combine_vocabulary, .inorder = FALSE, .multicombine = TRUE, 
         ...) %dopar% {
         create_vocabulary(it, ngram, stopwords)
     }
  4: e$fun(obj, substitute(ex), parent.frame(), e$data)
  
  ── 9. Error: itoken list parallel (@test-iterators.R#72)  ──────────────────────
  task 1 failed - "not a function"
  1: create_vocabulary(it2) at testthat/test-iterators.R:72
  2: create_vocabulary.itoken_parallel(it2)
  3: foreach(it = it, .combine = combine_vocabulary, .inorder = FALSE, .multicombine = TRUE, 
         ...) %dopar% {
         create_vocabulary(it, ngram, stopwords)
     }
  4: e$fun(obj, substitute(ex), parent.frame(), e$data)
  
  ── 10. Error: itoken list non-character (@test-iterators.R#79)  ────────────────
  task 1 failed - "not a function"
  1: create_vocabulary(it2) at testthat/test-iterators.R:79
  2: create_vocabulary.itoken_parallel(it2)
  3: foreach(it = it, .combine = combine_vocabulary, .inorder = FALSE, .multicombine = TRUE, 
         ...) %dopar% {
         create_vocabulary(it, ngram, stopwords)
     }
  4: e$fun(obj, substitute(ex), parent.frame(), e$data)
  
  ── 11. Error: immutable input iterators (@test-iterators.R#90)  ────────────────
  not a function
  1: create_vocabulary(it) at testthat/test-iterators.R:90
  2: create_vocabulary.itoken(it)
  3: it$clone(deep = TRUE)
  4: copy_slice(old[[i]], new[[i]], old_new_enclosing_pairs[seq.int(i, length(old))], 
         (i == 1))
  5: makeActiveBinding(name, active_copies[[name]], new_slice$binding)
  
  ── 12. Error: (unknown) (@test-lda.R#12)  ──────────────────────────────────────
  not a function
  1: create_vocabulary(it) at testthat/test-lda.R:12
  2: create_vocabulary.itoken(it)
  3: it$clone(deep = TRUE)
  4: copy_slice(old[[i]], new[[i]], old_new_enclosing_pairs[seq.int(i, length(old))], 
         (i == 1))
  5: makeActiveBinding(name, active_copies[[name]], new_slice$binding)
  
  ── 13. Error: (unknown) (@test-lsa.R#11)  ──────────────────────────────────────
  not a function
  1: create_vocabulary(it) at testthat/test-lsa.R:11
  2: create_vocabulary.itoken(it)
  3: it$clone(deep = TRUE)
  4: copy_slice(old[[i]], new[[i]], old_new_enclosing_pairs[seq.int(i, length(old))], 
         (i == 1))
  5: makeActiveBinding(name, active_copies[[name]], new_slice$binding)
  
  ── 14. Error: (unknown) (@test-s3-interface.R#11)  ─────────────────────────────
  not a function
  1: create_vocabulary(it) at testthat/test-s3-interface.R:11
  2: create_vocabulary.itoken(it)
  3: it$clone(deep = TRUE)
  4: copy_slice(old[[i]], new[[i]], old_new_enclosing_pairs[seq.int(i, length(old))], 
         (i == 1))
  5: makeActiveBinding(name, active_copies[[name]], new_slice$binding)
  
  ── 15. Error: tcm (@test-tcm.R#16)  ────────────────────────────────────────────
  not a function
  1: create_vocabulary(it, c(1L, 1L)) at testthat/test-tcm.R:16
  2: create_vocabulary.itoken(it, c(1L, 1L))
  3: it$clone(deep = TRUE)
  4: copy_slice(old[[i]], new[[i]], old_new_enclosing_pairs[seq.int(i, length(old))], 
         (i == 1))
  5: makeActiveBinding(name, active_copies[[name]], new_slice$binding)
  
  ── 16. Error: (unknown) (@test-utils.R#6)  ─────────────────────────────────────
  not a function
  1: create_dtm(it, hash_vectorizer(2^8), "dgTMatrix") at testthat/test-utils.R:6
  2: create_dtm.itoken(it, hash_vectorizer(2^8), "dgTMatrix")
  3: vectorizer(it, grow_dtm = TRUE, skip_grams_window_context = "symmetric", window_size = 0, 
         weights = numeric(0))
  4: corpus_insert(hash_corpus_ptr, iterator, grow_dtm, skip_grams_window_context, window_size, 
         weights)
  5: iterator$clone(deep = TRUE)
  6: copy_slice(old[[i]], new[[i]], old_new_enclosing_pairs[seq.int(i, length(old))], 
         (i == 1))
  7: makeActiveBinding(name, active_copies[[name]], new_slice$binding)
  
  ── 17. Error: Vocabulary pruning (@test-vocab-corpus.R#14)  ────────────────────
  not a function
  1: create_vocabulary(it) at testthat/test-vocab-corpus.R:14
  2: create_vocabulary.itoken(it)
  3: it$clone(deep = TRUE)
  4: copy_slice(old[[i]], new[[i]], old_new_enclosing_pairs[seq.int(i, length(old))], 
         (i == 1))
  5: makeActiveBinding(name, active_copies[[name]], new_slice$binding)
  
  ── 18. Error: Vocabulary stopwords (@test-vocab-corpus.R#72)  ──────────────────
  not a function
  1: create_vocabulary(it, stopwords = STOP_WORDS) at testthat/test-vocab-corpus.R:72
  2: create_vocabulary.itoken(it, stopwords = STOP_WORDS)
  3: it$clone(deep = TRUE)
  4: copy_slice(old[[i]], new[[i]], old_new_enclosing_pairs[seq.int(i, length(old))], 
         (i == 1))
  5: makeActiveBinding(name, active_copies[[name]], new_slice$binding)
  
  ── 19. Error: Unigran Vocabulary Corpus construction (@test-vocab-corpus.R#79)  
  not a function
  1: create_vocabulary(it) at testthat/test-vocab-corpus.R:79
  2: create_vocabulary.itoken(it)
  3: it$clone(deep = TRUE)
  4: copy_slice(old[[i]], new[[i]], old_new_enclosing_pairs[seq.int(i, length(old))], 
         (i == 1))
  5: makeActiveBinding(name, active_copies[[name]], new_slice$binding)
  
  ── 20. Error: bi-gram Vocabulary Corpus construction (@test-vocab-corpus.R#100) 
  not a function
  1: create_vocabulary(it, ngram = c(ngram_min = 2L, ngram_max = 2L)) at testthat/test-vocab-corpus.R:100
  2: create_vocabulary.itoken(it, ngram = c(ngram_min = 2L, ngram_max = 2L))
  3: it$clone(deep = TRUE)
  4: copy_slice(old[[i]], new[[i]], old_new_enclosing_pairs[seq.int(i, length(old))], 
         (i == 1))
  5: makeActiveBinding(name, active_copies[[name]], new_slice$binding)
  
  ── 21. Error: Unigram + Bigram Vocabulary Corpus construction (@test-vocab-corpu
  not a function
  1: create_vocabulary(it, ngram = c(ngram_min = 1L, ngram_max = 2L)) at testthat/test-vocab-corpus.R:118
  2: create_vocabulary.itoken(it, ngram = c(ngram_min = 1L, ngram_max = 2L))
  3: it$clone(deep = TRUE)
  4: copy_slice(old[[i]], new[[i]], old_new_enclosing_pairs[seq.int(i, length(old))], 
         (i == 1))
  5: makeActiveBinding(name, active_copies[[name]], new_slice$binding)
  
  ── 22. Error: create_dtm (@test-vocab-corpus.R#133)  ───────────────────────────
  not a function
  1: create_dtm(it, hash_vectorizer(n_hash)) at testthat/test-vocab-corpus.R:133
  2: create_dtm.itoken(it, hash_vectorizer(n_hash))
  3: vectorizer(it, grow_dtm = TRUE, skip_grams_window_context = "symmetric", window_size = 0, 
         weights = numeric(0))
  4: corpus_insert(hash_corpus_ptr, iterator, grow_dtm, skip_grams_window_context, window_size, 
         weights)
  5: iterator$clone(deep = TRUE)
  6: copy_slice(old[[i]], new[[i]], old_new_enclosing_pairs[seq.int(i, length(old))], 
         (i == 1))
  7: makeActiveBinding(name, active_copies[[name]], new_slice$binding)
  
  ── 23. Error: Vocabulary with foreach (@test-vocab-high-level.R#21)  ───────────
  not a function
  1: create_vocabulary(iterator) at testthat/test-vocab-high-level.R:21
  2: create_vocabulary.itoken(iterator)
  3: it$clone(deep = TRUE)
  4: copy_slice(old[[i]], new[[i]], old_new_enclosing_pairs[seq.int(i, length(old))], 
         (i == 1))
  5: makeActiveBinding(name, active_copies[[name]], new_slice$binding)
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  [ OK: 0 | SKIPPED: 1 | WARNINGS: 0 | FAILED: 23 ]
  1. Error: (unknown) (@test-colloc.R#12) 
  2. Error: (unknown) (@test-distances.R#11) 
  3. Error: Unigram Hash Corpus construction (@test-hash-corpus.R#15) 
  4. Error: trigram hash-corpus construction (@test-hash-corpus.R#33) 
  5. Error: ifiles (@test-iterators.R#23) 
  6. Error: ifiles_parallel (@test-iterators.R#36) 
  7. Error: itoken character (@test-iterators.R#59) 
  8. Error: itoken character parallel (@test-iterators.R#65) 
  9. Error: itoken list parallel (@test-iterators.R#72) 
  1. ...
  
  Error: testthat unit tests failed
  Execution halted