Running 'spelling.R' [0s/0s]
  Running 'testthat.R' [10s/11s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(LexisNexisTools)
  LexisNexisTools Version 0.2.2
  > 
  > test_check("LexisNexisTools")
  Creating LNToutput from input 1 files...
  
  	...processing date 2010-01-08: 0 duplicates found [0.22 secs]. 		
  	...processing date 2010-01-09: 0 duplicates found [0.22 secs]. 		
  	...processing date 2010-01-10: 2 duplicates found [0.85 secs]. 		-- 1. Error: (unknown) (@test-lnt_diff.R#4)  -----------------------------------
  arguments imply differing number of rows: 15, 36
  1: lnt_similarity(LNToutput = lnt_read(system.file("extdata", "sample.TXT", package = "LexisNexisTools"), 
         verbose = FALSE), threshold = 0.95, verbose = FALSE) at testthat/test-lnt_diff.R:4
  2: lapply(dates.d, function(x) {
         if (sum(x == na.omit(dates)) > 1) {
             text_dfm_day <- quanteda::dfm_subset(text_dfm, subset = (dates == x))
             sim <- quanteda::textstat_simil(text_dfm_day, selection = NULL, method = "cosine", 
                 margin = "documents")
             . <- t(combn(as.numeric(quanteda::docnames(text_dfm_day)), 2))
             colnames(.) <- c("ID_original", "ID_duplicate")
             duplicates.df <- data.frame(., Similarity = as.numeric(sim), stringsAsFactors = FALSE)
             duplicates.df <- duplicates.df[duplicates.df$Similarity > threshold, ]
             if (nrow(duplicates.df) > 0) {
                 duplicates.df$text_original <- texts[match(duplicates.df$ID_original, 
                     IDs)]
                 duplicates.df$text_duplicate <- texts[match(duplicates.df$ID_duplicate, 
                     IDs)]
                 duplicates.df$Date <- dates[match(duplicates.df$ID_duplicate, IDs)]
                 duplicates.df <- duplicates.df[, c("Date", "ID_original", "text_original", 
                     "ID_duplicate", "text_duplicate", "Similarity")]
                 if (rel_dist) {
                     duplicates.df$rel_dist <- sapply(seq_len(nrow(duplicates.df)), function(i) {
                       mxln <- max(c(nchar(duplicates.df$text_original[i]), nchar(duplicates.df$text_duplicate[i])))
                       if (isTRUE(abs(nchar(duplicates.df$text_original[i]) - nchar(duplicates.df$text_duplicate[i]))/mxln < 
                         length_diff & max_length > mxln)) {
                         stringdist::stringdist(a = duplicates.df$text_original[i], b = duplicates.df$text_duplicate[i], 
                           method = "lv", useBytes = FALSE, nthread = nthread)/mxln
                       }
                       else {
                         NA
                       }
                     })
                 }
                 cat("\r\t...processing date ", as.character(x), ": ", nrow(duplicates.df), 
                     " duplicates found [", format((Sys.time() - start_time), digits = 2, 
                       nsmall = 2), "]. \t\t", sep = "")
                 duplicates.df
             }
             else {
                 cat("\r\t...processing date ", as.character(x), ": 0 duplicates found [", 
                     format((Sys.time() - start_time), digits = 2, nsmall = 2), "]. \t\t", 
                     sep = "")
             }
         }
         else {
             cat("\r\t...processing date ", as.character(x), ": 0 duplicates found [", 
                 format((Sys.time() - start_time), digits = 2, nsmall = 2), "]. \t\t", 
                 sep = "")
         }
     })
  3: FUN(X[[i]], ...)
  4: data.frame(., Similarity = as.numeric(sim), stringsAsFactors = FALSE)
  5: stop(gettextf("arguments imply differing number of rows: %s", paste(unique(nrows), 
         collapse = ", ")), domain = NA)
  
  Creating LNToutput from input 1 files...
  
     |                                                  | 0 % ~calculating  
     |+++++                                             | 10% ~00s          
     |++++++++++                                        | 20% ~00s          
     |+++++++++++++++                                   | 30% ~00s          
     |++++++++++++++++++++                              | 40% ~00s          
     |+++++++++++++++++++++++++                         | 50% ~00s          
     |++++++++++++++++++++++++++++++                    | 60% ~00s          
     |+++++++++++++++++++++++++++++++++++               | 70% ~00s          
     |++++++++++++++++++++++++++++++++++++++++         | 80% ~00s          
     |+++++++++++++++++++++++++++++++++++++++++++++    | 90% ~00s          
     |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed = 00s
  Creating LNToutput from input 1 files...
  	...files loaded [0.0014 secs]
  	...articles split [0.014 secs]
  	...lengths extracted [0.015 secs]
  	...newspapers extracted [0.016 secs]
  	...dates extracted [0.022 secs]
  	...authors extracted [0.023 secs]
  	...sections extracted [0.024 secs]
  	...editions extracted [0.025 secs]
  	...headlines extracted [0.029 secs]
  	...dates converted [0.053 secs]
  	...metadata extracted [0.056 secs]
  	...article texts extracted [0.062 secs]
  	...paragraphs extracted [0.087 secs]
  	...superfluous whitespace removed from articles [0.092 secs]
  	...superfluous whitespace removed from paragraphs [0.097 secs]
  Elapsed time: 0.098 secs
  Creating LNToutput from input 2 files...
  	...files loaded [0.0029 secs]
  	...articles split [0.062 secs]
  	...lengths extracted [0.064 secs]
  	...newspapers extracted [0.065 secs]
  	...dates extracted [0.094 secs]
  	...authors extracted [0.096 secs]
  	...sections extracted [0.097 secs]
  	...editions extracted [0.099 secs]
  	...headlines extracted [0.12 secs]
  	...dates converted [0.13 secs]
  	...metadata extracted [0.13 secs]
  	...article texts extracted [0.16 secs]
  	...paragraphs extracted [0.19 secs]
  	...superfluous whitespace removed from articles [0.22 secs]
  	...superfluous whitespace removed from paragraphs [0.23 secs]
  Elapsed time: 0.23 secs
  Creating LNToutput from input 2 files...
  	...files loaded [0.0029 secs]
  	...articles split [0.061 secs]
  	...lengths extracted [0.063 secs]
  	...newspapers extracted [0.064 secs]
  	...dates extracted [0.091 secs]
  	...authors extracted [0.093 secs]
  	...sections extracted [0.095 secs]
  	...editions extracted [0.096 secs]
  	...headlines extracted [0.10 secs]
  	...dates converted [0.12 secs]
  	...metadata extracted [0.12 secs]
  	...article texts extracted [0.13 secs]
  	...superfluous whitespace removed from articles [0.14 secs]
  	...superfluous whitespace removed from paragraphs [0.14 secs]
  Elapsed time: 0.14 secs
  in 0.0023 secs [changes were only simulated]in 0.0024 secs1 not renamed (file already exists), in 0.0024 secs [changes were only simulated]Creating LNToutput from input 1 files...
  Checking similiarity for 10 articles over 4 dates...
  	...quanteda dfm construced for similarity comparison [0.073 secs].
  	...processing date 2010-01-08: 0 duplicates found [0.074 secs]. 		
  	...processing date 2010-01-09: 0 duplicates found [0.075 secs]. 		
  	...processing date 2010-01-10: 2 duplicates found [0.62 secs]. 		-- 2. Error: Test similarity (@test-lnt_similarity.R#10)  ----------------------
  arguments imply differing number of rows: 15, 36
  1: expect_equal(lnt_similarity(LNToutput = LNToutput), readRDS("../files/duplicates.df.RDS")) at testthat/test-lnt_similarity.R:10
  2: quasi_label(enquo(object), label, arg = "object")
  3: eval_bare(get_expr(quo), get_env(quo))
  4: lnt_similarity(LNToutput = LNToutput)
  5: lapply(dates.d, function(x) {
         if (sum(x == na.omit(dates)) > 1) {
             text_dfm_day <- quanteda::dfm_subset(text_dfm, subset = (dates == x))
             sim <- quanteda::textstat_simil(text_dfm_day, selection = NULL, method = "cosine", 
                 margin = "documents")
             . <- t(combn(as.numeric(quanteda::docnames(text_dfm_day)), 2))
             colnames(.) <- c("ID_original", "ID_duplicate")
             duplicates.df <- data.frame(., Similarity = as.numeric(sim), stringsAsFactors = FALSE)
             duplicates.df <- duplicates.df[duplicates.df$Similarity > threshold, ]
             if (nrow(duplicates.df) > 0) {
                 duplicates.df$text_original <- texts[match(duplicates.df$ID_original, 
                     IDs)]
                 duplicates.df$text_duplicate <- texts[match(duplicates.df$ID_duplicate, 
                     IDs)]
                 duplicates.df$Date <- dates[match(duplicates.df$ID_duplicate, IDs)]
                 duplicates.df <- duplicates.df[, c("Date", "ID_original", "text_original", 
                     "ID_duplicate", "text_duplicate", "Similarity")]
                 if (rel_dist) {
                     duplicates.df$rel_dist <- sapply(seq_len(nrow(duplicates.df)), function(i) {
                       mxln <- max(c(nchar(duplicates.df$text_original[i]), nchar(duplicates.df$text_duplicate[i])))
                       if (isTRUE(abs(nchar(duplicates.df$text_original[i]) - nchar(duplicates.df$text_duplicate[i]))/mxln < 
                         length_diff & max_length > mxln)) {
                         stringdist::stringdist(a = duplicates.df$text_original[i], b = duplicates.df$text_duplicate[i], 
                           method = "lv", useBytes = FALSE, nthread = nthread)/mxln
                       }
                       else {
                         NA
                       }
                     })
                 }
                 cat("\r\t...processing date ", as.character(x), ": ", nrow(duplicates.df), 
                     " duplicates found [", format((Sys.time() - start_time), digits = 2, 
                       nsmall = 2), "]. \t\t", sep = "")
                 duplicates.df
             }
             else {
                 cat("\r\t...processing date ", as.character(x), ": 0 duplicates found [", 
                     format((Sys.time() - start_time), digits = 2, nsmall = 2), "]. \t\t", 
                     sep = "")
             }
         }
         else {
             cat("\r\t...processing date ", as.character(x), ": 0 duplicates found [", 
                 format((Sys.time() - start_time), digits = 2, nsmall = 2), "]. \t\t", 
                 sep = "")
         }
     })
  6: FUN(X[[i]], ...)
  7: data.frame(., Similarity = as.numeric(sim), stringsAsFactors = FALSE)
  8: stop(gettextf("arguments imply differing number of rows: %s", paste(unique(nrows), 
         collapse = ", ")), domain = NA)
  
  Checking similiarity for 9 articles over 4 dates...
  	...quanteda dfm construced for similarity comparison [0.064 secs].
  	...processing date 2010-01-08: 0 duplicates found [0.065 secs]. 		
  	...processing date 2010-01-09: 0 duplicates found [0.065 secs]. 		
  	...processing date 2010-01-10: 2 duplicates found [0.64 secs]. 		-- 3. Error: Test similarity warnings and errors (@test-lnt_similarity.R#28)  --
  arguments imply differing number of rows: 15, 36
  1: expect_warning(lnt_similarity(texts = c(LNToutput@articles$Article[1:9], ""), dates = LNToutput@meta$Date), 
         "At least one of the supplied texts had length 0. These articles with the following IDs will be ignored: 10") at testthat/test-lnt_similarity.R:28
  2: quasi_capture(enquo(object), label, capture_warnings)
  3: .capture(act$val <- eval_bare(get_expr(.quo), get_env(.quo)), ...)
  4: withCallingHandlers(code, warning = function(condition) {
         out$push(condition)
         invokeRestart("muffleWarning")
     })
  5: eval_bare(get_expr(.quo), get_env(.quo))
  6: lnt_similarity(texts = c(LNToutput@articles$Article[1:9], ""), dates = LNToutput@meta$Date)
  7: lapply(dates.d, function(x) {
         if (sum(x == na.omit(dates)) > 1) {
             text_dfm_day <- quanteda::dfm_subset(text_dfm, subset = (dates == x))
             sim <- quanteda::textstat_simil(text_dfm_day, selection = NULL, method = "cosine", 
                 margin = "documents")
             . <- t(combn(as.numeric(quanteda::docnames(text_dfm_day)), 2))
             colnames(.) <- c("ID_original", "ID_duplicate")
             duplicates.df <- data.frame(., Similarity = as.numeric(sim), stringsAsFactors = FALSE)
             duplicates.df <- duplicates.df[duplicates.df$Similarity > threshold, ]
             if (nrow(duplicates.df) > 0) {
                 duplicates.df$text_original <- texts[match(duplicates.df$ID_original, 
                     IDs)]
                 duplicates.df$text_duplicate <- texts[match(duplicates.df$ID_duplicate, 
                     IDs)]
                 duplicates.df$Date <- dates[match(duplicates.df$ID_duplicate, IDs)]
                 duplicates.df <- duplicates.df[, c("Date", "ID_original", "text_original", 
                     "ID_duplicate", "text_duplicate", "Similarity")]
                 if (rel_dist) {
                     duplicates.df$rel_dist <- sapply(seq_len(nrow(duplicates.df)), function(i) {
                       mxln <- max(c(nchar(duplicates.df$text_original[i]), nchar(duplicates.df$text_duplicate[i])))
                       if (isTRUE(abs(nchar(duplicates.df$text_original[i]) - nchar(duplicates.df$text_duplicate[i]))/mxln < 
                         length_diff & max_length > mxln)) {
                         stringdist::stringdist(a = duplicates.df$text_original[i], b = duplicates.df$text_duplicate[i], 
                           method = "lv", useBytes = FALSE, nthread = nthread)/mxln
                       }
                       else {
                         NA
                       }
                     })
                 }
                 cat("\r\t...processing date ", as.character(x), ": ", nrow(duplicates.df), 
                     " duplicates found [", format((Sys.time() - start_time), digits = 2, 
                       nsmall = 2), "]. \t\t", sep = "")
                 duplicates.df
             }
             else {
                 cat("\r\t...processing date ", as.character(x), ": 0 duplicates found [", 
                     format((Sys.time() - start_time), digits = 2, nsmall = 2), "]. \t\t", 
                     sep = "")
             }
         }
         else {
             cat("\r\t...processing date ", as.character(x), ": 0 duplicates found [", 
                 format((Sys.time() - start_time), digits = 2, nsmall = 2), "]. \t\t", 
                 sep = "")
         }
     })
  8: FUN(X[[i]], ...)
  9: data.frame(., Similarity = as.numeric(sim), stringsAsFactors = FALSE)
  10: stop(gettextf("arguments imply differing number of rows: %s", paste(unique(nrows), 
         collapse = ", ")), domain = NA)
  
  Creating LNToutput from input 1 files...
  == testthat results  ===========================================================
  OK: 38 SKIPPED: 0 WARNINGS: 0 FAILED: 3
  1. Error: (unknown) (@test-lnt_diff.R#4) 
  2. Error: Test similarity (@test-lnt_similarity.R#10) 
  3. Error: Test similarity warnings and errors (@test-lnt_similarity.R#28) 
  
  Error: testthat unit tests failed
  Execution halted