Running ‘testhat.R’
Running the tests in ‘tests/testhat.R’ failed.
Complete output:
  > if (packageVersion("testthat") >= "0.7.1.99") {
  +     library(testthat)  
  +     test_check("mlvocab")
  + }
  Loading required package: mlvocab
  Loading required package: Rcpp
  Loading required package: Matrix
  Loading required package: digest
  Loading required package: sparsepp
  ── 1. Error: dtm output type is correct (@test_term_matrices.R#144)  ───────────
  Internal error: Incomplete compactification (ncompacted: 4, npris: 2)
  1: dtm(corpus, vocab, output = "tri") at testthat/test_term_matrices.R:144
  2: tm(C_dtm, corpus, vocab, ngram, nbuckets, output)
  3: do.call(cfun, list(corpus, vocab, NULL, nbuckets, output, ..., ngram_min = ngram[[1]], 
         ngram_max = ngram[[2]]))
  4: (function (corpus0, vocabdf, term_weights, nbuckets, output, ngram_min, ngram_max) 
     {
         .Call(`_mlvocab_C_dtm`, corpus0, vocabdf, term_weights, nbuckets, output, ngram_min, 
             ngram_max)
     })(list(a = c("The", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog"
     ), b = c("the", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog", "the", 
     "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog")), structure(list(
         term = c("the", "quick", "brown", "fox", "jumps", "over", "lazy", "dog", "The"
         ), term_count = c(5L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 1L), doc_count = c(2L, 2L, 
         2L, 2L, 2L, 2L, 2L, 2L, 1L)), class = c("mlvocab_vocab", "data.frame"), row.names = c(NA, 
     -9L), ngram = c(1L, 1L), document_count = 2L, nbuckets = 0L, ngram_sep = "_", regex = "[[:space:]]+"), 
         NULL, 0L, "triplet", ngram_min = 1L, ngram_max = 1L)
  
  ── 2. Error: dtm works with NULL names (@test_term_matrices.R#167)  ────────────
  Internal error: Incomplete compactification (ncompacted: 4, npris: 2)
  1: dtm(corpus, v, output = "triplet") at testthat/test_term_matrices.R:167
  2: tm(C_dtm, corpus, vocab, ngram, nbuckets, output)
  3: do.call(cfun, list(corpus, vocab, NULL, nbuckets, output, ..., ngram_min = ngram[[1]], 
         ngram_max = ngram[[2]]))
  4: (function (corpus0, vocabdf, term_weights, nbuckets, output, ngram_min, ngram_max) 
     {
         .Call(`_mlvocab_C_dtm`, corpus0, vocabdf, term_weights, nbuckets, output, ngram_min, 
             ngram_max)
     })(list(c("The", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog"), 
         c("the", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog", "the", 
         "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog")), structure(list(
         term = c("the", "quick", "brown", "fox", "jumps", "over", "lazy", "dog", "The"
         ), term_count = c(5L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 1L), doc_count = c(2L, 2L, 
         2L, 2L, 2L, 2L, 2L, 2L, 1L)), class = c("mlvocab_vocab", "data.frame"), row.names = c(NA, 
     -9L), ngram = c(1L, 1L), document_count = 2L, nbuckets = 0L, ngram_sep = "_", regex = "[[:space:]]+"), 
         NULL, 0L, "triplet", ngram_min = 1L, ngram_max = 1L)
  
  ── 3. Error: tdm works (@test_term_matrices.R#188)  ────────────────────────────
  Internal error: Incomplete compactification (ncompacted: 4, npris: 2)
  1: tdm(corpus, v, output = "tri") at testthat/test_term_matrices.R:188
  2: tm(C_tdm, corpus, vocab, ngram, nbuckets, output)
  3: do.call(cfun, list(corpus, vocab, NULL, nbuckets, output, ..., ngram_min = ngram[[1]], 
         ngram_max = ngram[[2]]))
  4: (function (corpus0, vocabdf, term_weights, nbuckets, output, ngram_min, ngram_max) 
     {
         .Call(`_mlvocab_C_tdm`, corpus0, vocabdf, term_weights, nbuckets, output, ngram_min, 
             ngram_max)
     })(list(a = c("The", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog"
     ), b = c("the", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog", "the", 
     "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog")), structure(list(
         term = c("the", "quick", "brown", "fox", "jumps", "over", "lazy", "dog", "The"
         ), term_count = c(5L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 1L), doc_count = c(2L, 2L, 
         2L, 2L, 2L, 2L, 2L, 2L, 1L)), class = c("mlvocab_vocab", "data.frame"), row.names = c(NA, 
     -9L), ngram = c(1L, 1L), document_count = 2L, nbuckets = 0L, ngram_sep = "_", regex = "[[:space:]]+"), 
         NULL, 0L, "triplet", ngram_min = 1L, ngram_max = 1L)
  
  ── 4. Error: tdm works with NULL names (@test_term_matrices.R#212)  ────────────
  Internal error: Incomplete compactification (ncompacted: 4, npris: 2)
  1: tdm(corpus, v, output = "triplet") at testthat/test_term_matrices.R:212
  2: tm(C_tdm, corpus, vocab, ngram, nbuckets, output)
  3: do.call(cfun, list(corpus, vocab, NULL, nbuckets, output, ..., ngram_min = ngram[[1]], 
         ngram_max = ngram[[2]]))
  4: (function (corpus0, vocabdf, term_weights, nbuckets, output, ngram_min, ngram_max) 
     {
         .Call(`_mlvocab_C_tdm`, corpus0, vocabdf, term_weights, nbuckets, output, ngram_min, 
             ngram_max)
     })(list(c("The", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog"), 
         c("the", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog", "the", 
         "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog")), structure(list(
         term = c("the", "quick", "brown", "fox", "jumps", "over", "lazy", "dog", "The"
         ), term_count = c(5L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 1L), doc_count = c(2L, 2L, 
         2L, 2L, 2L, 2L, 2L, 2L, 1L)), class = c("mlvocab_vocab", "data.frame"), row.names = c(NA, 
     -9L), ngram = c(1L, 1L), document_count = 2L, nbuckets = 0L, ngram_sep = "_", regex = "[[:space:]]+"), 
         NULL, 0L, "triplet", ngram_min = 1L, ngram_max = 1L)
  
  ── 5. Error: tdm, dtm and tcm work with vocab=NULL (@test_term_matrices.R#230)  
  Internal error: Incomplete compactification (ncompacted: 4, npris: 2)
  1: expect_equal(tdm(corpus, v, output = "triplet"), tdm(corpus, output = "triplet")) at testthat/test_term_matrices.R:230
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: tdm(corpus, v, output = "triplet")
  5: tm(C_tdm, corpus, vocab, ngram, nbuckets, output)
  6: do.call(cfun, list(corpus, vocab, NULL, nbuckets, output, ..., ngram_min = ngram[[1]], 
         ngram_max = ngram[[2]]))
  7: (function (corpus0, vocabdf, term_weights, nbuckets, output, ngram_min, ngram_max) 
     {
         .Call(`_mlvocab_C_tdm`, corpus0, vocabdf, term_weights, nbuckets, output, ngram_min, 
             ngram_max)
     })(list(a = c("The", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog"
     ), b = c("the", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog", "the", 
     "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog")), structure(list(
         term = c("the", "quick", "brown", "fox", "jumps", "over", "lazy", "dog", "The"
         ), term_count = c(5L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 1L), doc_count = c(2L, 2L, 
         2L, 2L, 2L, 2L, 2L, 2L, 1L)), class = c("mlvocab_vocab", "data.frame"), row.names = c(NA, 
     -9L), ngram = c(1L, 1L), document_count = 2L, nbuckets = 0L, ngram_sep = "_", regex = "[[:space:]]+"), 
         NULL, 0L, "triplet", ngram_min = 1L, ngram_max = 1L)
  
  ── 6. Error: tdm/dtm work with empty docs (@test_term_matrices.R#238)  ─────────
  Internal error: Incomplete compactification (ncompacted: 6, npris: 3)
  1: expect_equal(as.matrix(dtm(c(corpus, list(c = character())), v)), rbind(mat, c = 0)) at testthat/test_term_matrices.R:238
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: as.matrix(dtm(c(corpus, list(c = character())), v))
  5: dtm(c(corpus, list(c = character())), v)
  6: tm(C_dtm, corpus, vocab, ngram, nbuckets, output)
  7: do.call(cfun, list(corpus, vocab, NULL, nbuckets, output, ..., ngram_min = ngram[[1]], 
         ngram_max = ngram[[2]]))
  8: (function (corpus0, vocabdf, term_weights, nbuckets, output, ngram_min, ngram_max) 
     {
         .Call(`_mlvocab_C_dtm`, corpus0, vocabdf, term_weights, nbuckets, output, ngram_min, 
             ngram_max)
     })(list(a = c("The", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog"
     ), b = c("the", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog", "the", 
     "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog"), c = character(0)), 
         structure(list(term = c("the", "quick", "brown", "fox", "jumps", "over", "lazy", 
         "dog", "The"), term_count = c(5L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 1L), doc_count = c(2L, 
         2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L)), class = c("mlvocab_vocab", "data.frame"), row.names = c(NA, 
         -9L), ngram = c(1L, 1L), document_count = 2L, nbuckets = 0L, ngram_sep = "_", regex = "[[:space:]]+"), 
         NULL, 0L, "row", ngram_min = 1L, ngram_max = 1L)
  
  ── 7. Error: tfidf works with tdm and dtm matrices (@test_tfidf.R#12)  ─────────
  Internal error: Incomplete compactification (ncompacted: 4, npris: 2)
  1: dtm(corpus, v, output = "col") at testthat/test_tfidf.R:12
  2: tm(C_dtm, corpus, vocab, ngram, nbuckets, output)
  3: do.call(cfun, list(corpus, vocab, NULL, nbuckets, output, ..., ngram_min = ngram[[1]], 
         ngram_max = ngram[[2]]))
  4: (function (corpus0, vocabdf, term_weights, nbuckets, output, ngram_min, ngram_max) 
     {
         .Call(`_mlvocab_C_dtm`, corpus0, vocabdf, term_weights, nbuckets, output, ngram_min, 
             ngram_max)
     })(list(a = c("The", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog"
     ), b = c("the", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog", "the", 
     "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog")), structure(list(
         term = c("the", "dog", "quick", "quick brown", "brown", "brown fox", "fox", "fox jumps", 
         "jumps", "jumps over", "over", "over the", "the lazy", "lazy", "lazy dog", "the quick", 
         "The", "dog the", "The quick"), term_count = c(5L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
         3L, 3L, 3L, 3L, 3L, 3L, 3L, 2L, 1L, 1L, 1L), doc_count = c(2L, 2L, 2L, 2L, 2L, 
         2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L)), class = c("mlvocab_vocab", 
     "data.frame"), row.names = c(NA, -19L), ngram = 1:2, document_count = 2L, nbuckets = 0L, ngram_sep = " ", regex = "[[:space:]]+"), 
         NULL, 0L, "column", ngram_min = 1L, ngram_max = 2L)
  
  ── 8. Error: tfidf works when dtm is constructed with explicit ngram (@test_tfid
  Internal error: Incomplete compactification (ncompacted: 4, npris: 2)
  1: dtm(corpus, v, c(1, 1), output = "col") at testthat/test_tfidf.R:96
  2: tm(C_dtm, corpus, vocab, ngram, nbuckets, output)
  3: do.call(cfun, list(corpus, vocab, NULL, nbuckets, output, ..., ngram_min = ngram[[1]], 
         ngram_max = ngram[[2]]))
  4: (function (corpus0, vocabdf, term_weights, nbuckets, output, ngram_min, ngram_max) 
     {
         .Call(`_mlvocab_C_dtm`, corpus0, vocabdf, term_weights, nbuckets, output, ngram_min, 
             ngram_max)
     })(list(a = c("The", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog"
     ), b = c("the", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog", "the", 
     "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog")), structure(list(
         term = c("the", "dog", "quick", "quick brown", "brown", "brown fox", "fox", "fox jumps", 
         "jumps", "jumps over", "over", "over the", "the lazy", "lazy", "lazy dog", "the quick", 
         "The", "dog the", "The quick"), term_count = c(5L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
         3L, 3L, 3L, 3L, 3L, 3L, 3L, 2L, 1L, 1L, 1L), doc_count = c(2L, 2L, 2L, 2L, 2L, 
         2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L)), class = c("mlvocab_vocab", 
     "data.frame"), row.names = c(NA, -19L), ngram = 1:2, document_count = 2L, nbuckets = 0L, ngram_sep = " ", regex = "[[:space:]]+"), 
         NULL, 0L, "column", ngram_min = 1, ngram_max = 1)
  
  ── 9. Error: tfidf works when names don't match (@test_tfidf.R#131)  ───────────
  Internal error: Incomplete compactification (ncompacted: 4, npris: 2)
  1: dtm(corpus, v, out = "col") at testthat/test_tfidf.R:131
  2: tm(C_dtm, corpus, vocab, ngram, nbuckets, output)
  3: do.call(cfun, list(corpus, vocab, NULL, nbuckets, output, ..., ngram_min = ngram[[1]], 
         ngram_max = ngram[[2]]))
  4: (function (corpus0, vocabdf, term_weights, nbuckets, output, ngram_min, ngram_max) 
     {
         .Call(`_mlvocab_C_dtm`, corpus0, vocabdf, term_weights, nbuckets, output, ngram_min, 
             ngram_max)
     })(list(a = c("The", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog"
     ), b = c("the", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog", "the", 
     "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog")), structure(list(
         term = c("the", "dog", "quick", "quick brown", "brown", "brown fox", "fox", "fox jumps", 
         "jumps", "jumps over", "over", "over the", "the lazy", "lazy", "lazy dog", "the quick", 
         "The", "dog the", "The quick"), term_count = c(5L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
         3L, 3L, 3L, 3L, 3L, 3L, 3L, 2L, 1L, 1L, 1L), doc_count = c(2L, 2L, 2L, 2L, 2L, 
         2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L)), class = c("mlvocab_vocab", 
     "data.frame"), row.names = c(NA, -19L), ngram = 1:2, document_count = 2L, nbuckets = 0L, ngram_sep = " ", regex = "[[:space:]]+"), 
         NULL, 0L, "column", ngram_min = 1L, ngram_max = 2L)
  
  ── 10. Error: tcm bootstrap (@test_tfidf.R#185)  ───────────────────────────────
  Internal error: Incomplete compactification (ncompacted: 10, npris: 5)
  1: dtm(corpus, v, output = "col") at testthat/test_tfidf.R:185
  2: tm(C_dtm, corpus, vocab, ngram, nbuckets, output)
  3: do.call(cfun, list(corpus, vocab, NULL, nbuckets, output, ..., ngram_min = ngram[[1]], 
         ngram_max = ngram[[2]]))
  4: (function (corpus0, vocabdf, term_weights, nbuckets, output, ngram_min, ngram_max) 
     {
         .Call(`_mlvocab_C_dtm`, corpus0, vocabdf, term_weights, nbuckets, output, ngram_min, 
             ngram_max)
     })(list(a = c("The", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog"
     ), b = c("the", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog", "the", 
     "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog"), c = c("the", "quick", 
     "brown", "fox", "jumps", "over", "the", "lazy", "dog", "the", "quick", "brown", "fox", 
     "jumps", "over", "the", "lazy", "dog"), d = c("the", "quick", "brown", "fox", "jumps", 
     "over", "the", "lazy", "dog", "the", "quick", "brown", "fox", "jumps", "over", "the", 
     "lazy", "dog"), e = c("the", "quick", "brown", "fox", "jumps", "over", "the", "lazy", 
     "dog", "the", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog")), structure(list(
         term = c("the", "jumps", "dog", "lazy dog", "lazy", "the lazy", "over the", "over", 
         "jumps over", "fox jumps", "fox", "brown fox", "brown", "quick brown", "quick", 
         "the quick", "dog the", "The quick", "The"), term_count = c(17L, 9L, 9L, 9L, 
         9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 8L, 4L, 1L, 1L), doc_count = c(5L, 
         5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 4L, 4L, 1L, 1L)), class = c("mlvocab_vocab", 
     "data.frame"), row.names = c(NA, -19L), ngram = 1:2, document_count = 5L, nbuckets = 0L, ngram_sep = " ", regex = "[[:space:]]+"), 
         NULL, 0L, "column", ngram_min = 1L, ngram_max = 2L)
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 142 SKIPPED: 0 FAILED: 10
  1.  Error: dtm output type is correct (@test_term_matrices.R#144) 
  2.  Error: dtm works with NULL names (@test_term_matrices.R#167) 
  3.  Error: tdm works (@test_term_matrices.R#188) 
  4.  Error: tdm works with NULL names (@test_term_matrices.R#212) 
  5.  Error: tdm, dtm and tcm work with vocab=NULL (@test_term_matrices.R#230) 
  6.  Error: tdm/dtm work with empty docs (@test_term_matrices.R#238) 
  7.  Error: tfidf works with tdm and dtm matrices (@test_tfidf.R#12) 
  8.  Error: tfidf works when dtm is constructed with explicit ngram (@test_tfidf.R#96) 
  9.  Error: tfidf works when names don't match (@test_tfidf.R#131) 
  10. Error: tcm bootstrap (@test_tfidf.R#185) 
  
  Error: testthat unit tests failed
  Execution halted