Running ‘testthat.R’ [15s/29s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(taxa)
  
  Attaching package: 'taxa'
  
  The following object is masked from 'package:testthat':
  
      matches
  
  > 
  > test_check("taxa")
  ── 1. Error: NSE values can be found (@test--taxmap.R#214)  ────────────────────
  'names' attribute [17] must be the same length as the vector [2]
  1: expect_equal(test_obj$get_data(c("n_subtaxa", "n_legs", "reaction")), list(n_subtaxa = test_obj$n_subtaxa(), 
         n_legs = stats::setNames(test_obj$data$info$n_legs, test_obj$data$info$taxon_id), 
         reaction = test_obj$funcs$reaction(test_obj))) at testthat/test--taxmap.R:214
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: test_obj$get_data(c("n_subtaxa", "n_legs", "reaction"))
  5: lapply(output[is_func], function(f) {
         if (length(formals(f)) == 0) {
             return(f())
         }
         else {
             return(f(self))
         }
     })
  6: FUN(X[[i]], ...)
  7: f()
  8: vapply(self$subtaxa(recursive = TRUE, include_input = FALSE, value = "taxon_indexes"), 
         length, numeric(1))
  9: self$subtaxa(recursive = TRUE, include_input = FALSE, value = "taxon_indexes")
  10: private$parse_nse_taxon_subset(subset)
  
  ── 2. Error: All valid NSE values can be found (@test--taxmap.R#224)  ──────────
  'names' attribute [17] must be the same length as the vector [2]
  1: expect_equal(names(get_data(test_obj)), unname(all_names(test_obj))) at testthat/test--taxmap.R:224
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: get_data(test_obj)
  5: get_data.Taxonomy(test_obj)
  6: obj$get_data(...)
  7: lapply(output[is_func], function(f) {
         if (length(formals(f)) == 0) {
             return(f())
         }
         else {
             return(f(self))
         }
     })
  8: FUN(X[[i]], ...)
  9: f()
  10: vapply(self$supertaxa(recursive = TRUE, include_input = FALSE, value = "taxon_indexes", 
         na = FALSE), length, numeric(1))
  11: self$supertaxa(recursive = TRUE, include_input = FALSE, value = "taxon_indexes", 
         na = FALSE)
  12: private$parse_nse_taxon_subset(subset)
  
  ── 3. Error: Mapping between table observations and the edge list works (@test--
  'names' attribute [17] must be the same length as the vector [2]
  1: test_obj$obs("info") at testthat/test--taxmap.R:233
  2: private$parse_nse_taxon_subset(subset)
  
  ── 4. Error: Mapping between a subset of observations and the edge list works (@
  'names' attribute [17] must be the same length as the vector [2]
  1: expect_identical(test_obj$obs("info", subset = "b"), list(b = 1:4)) at testthat/test--taxmap.R:242
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: test_obj$obs("info", subset = "b")
  5: private$parse_nse_taxon_subset(subset)
  
  ── 5. Error: Mapping non-recursivly between observations and the edge list works
  'names' attribute [17] must be the same length as the vector [2]
  1: test_obj$obs("info", recursive = FALSE) at testthat/test--taxmap.R:247
  2: private$parse_nse_taxon_subset(subset)
  
  ── 6. Error: Mapping simplification between observations and the edge list works
  'names' attribute [17] must be the same length as the vector [2]
  1: expect_equal(test_obj$obs("info", simplify = TRUE), 1:6) at testthat/test--taxmap.R:253
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: test_obj$obs("info", simplify = TRUE)
  5: private$parse_nse_taxon_subset(subset)
  
  ── 7. Error: Mapping observations in external tables (@test--taxmap.R#259)  ────
  'names' attribute [17] must be the same length as the vector [2]
  1: expect_equal(test_obj$obs(external_table)$b, c(2, 1)) at testthat/test--taxmap.R:259
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: test_obj$obs(external_table)
  5: private$parse_nse_taxon_subset(subset)
  
  ── 8. Error: Default taxon filtering works (@test--taxmap.R#271)  ──────────────
  'names' attribute [17] must be the same length as the vector [2]
  1: filter_taxa(test_obj, taxon_names == "Solanum") at testthat/test--taxmap.R:271
  2: filter_taxa.Taxonomy(test_obj, taxon_names == "Solanum")
  3: obj$filter_taxa(...)
  4: private$parse_nse_taxon_subset(...)
  
  ── 9. Error: Subtaxa can be included when filtering taxa (@test--taxmap.R#279)  
  'names' attribute [17] must be the same length as the vector [2]
  1: filter_taxa(test_obj, taxon_names == "Solanum", subtaxa = TRUE) at testthat/test--taxmap.R:279
  2: filter_taxa.Taxonomy(test_obj, taxon_names == "Solanum", subtaxa = TRUE)
  3: obj$filter_taxa(...)
  4: private$parse_nse_taxon_subset(...)
  
  ── 10. Error: Supertaxa can be included when filtering taxa (@test--taxmap.R#289
  'names' attribute [17] must be the same length as the vector [2]
  1: filter_taxa(test_obj, taxon_names == "Solanum", supertaxa = TRUE) at testthat/test--taxmap.R:289
  2: filter_taxa.Taxonomy(test_obj, taxon_names == "Solanum", supertaxa = TRUE)
  3: obj$filter_taxa(...)
  4: private$parse_nse_taxon_subset(...)
  
  ── 11. Error: Observations can be preserved when filtering taxa (@test--taxmap.R
  'names' attribute [17] must be the same length as the vector [2]
  1: filter_taxa(test_obj, taxon_names == "Solanum", reassign_obs = FALSE) at testthat/test--taxmap.R:299
  2: filter_taxa.Taxonomy(test_obj, taxon_names == "Solanum", reassign_obs = FALSE)
  3: obj$filter_taxa(...)
  4: private$parse_nse_taxon_subset(...)
  
  ── 12. Error: Taxon ids can be preserved when filtering taxa (@test--taxmap.R#31
  'names' attribute [17] must be the same length as the vector [2]
  1: filter_taxa(test_obj, taxon_names != "Solanum", reassign_taxa = FALSE) at testthat/test--taxmap.R:316
  2: filter_taxa.Taxonomy(test_obj, taxon_names != "Solanum", reassign_taxa = FALSE)
  3: obj$filter_taxa(...)
  4: private$parse_nse_taxon_subset(...)
  
  ── 13. Error: The selection of taxa to be filtered can be inverted (@test--taxma
  'names' attribute [17] must be the same length as the vector [2]
  1: filter_taxa(test_obj, taxon_names == "Solanum", subtaxa = TRUE, invert = TRUE) at testthat/test--taxmap.R:321
  2: filter_taxa.Taxonomy(test_obj, taxon_names == "Solanum", subtaxa = TRUE, invert = TRUE)
  3: obj$filter_taxa(...)
  4: private$parse_nse_taxon_subset(...)
  
  ── 14. Error: Edge cases return reasonable outputs (@test--taxmap.R#328)  ──────
  'names' attribute [17] must be the same length as the vector [2]
  1: expect_equal(filter_taxa(test_obj), test_obj) at testthat/test--taxmap.R:328
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: filter_taxa(test_obj)
  5: filter_taxa.Taxonomy(test_obj)
  6: obj$filter_taxa(...)
  7: unique(c(selection, self$subtaxa(subset = selection, recursive = subtaxa, value = "taxon_indexes", 
         include_input = FALSE, simplify = TRUE), self$supertaxa(subset = selection, recursive = supertaxa, 
         value = "taxon_indexes", na = FALSE, simplify = TRUE, include_input = FALSE)))
  8: self$subtaxa(subset = selection, recursive = subtaxa, value = "taxon_indexes", include_input = FALSE, 
         simplify = TRUE)
  9: private$parse_nse_taxon_subset(subset)
  
  ── 15. Error: Removing taxa when filtering observations work (@test--taxmap.R#34
  'names' attribute [17] must be the same length as the vector [2]
  1: filter_obs(test_obj, "info", n_legs == 2, drop_taxa = TRUE) at testthat/test--taxmap.R:345
  2: filter_obs.Taxmap(test_obj, "info", n_legs == 2, drop_taxa = TRUE)
  3: obj$filter_obs(...)
  4: self$supertaxa(unique(data_taxon_ids[-selection]), na = FALSE, recursive = TRUE, 
         simplify = TRUE, include_input = TRUE, value = "taxon_indexes")
  5: private$parse_nse_taxon_subset(subset)
  
  ── 16. Error: Sampling observations works (@test--taxmap.R#520)  ───────────────
  'names' attribute [17] must be the same length as the vector [2]
  1: sample_n_taxa(test_obj, size = 3) at testthat/test--taxmap.R:520
  2: sample_n_taxa.Taxonomy(test_obj, size = 3)
  3: obj$sample_n_taxa(...)
  4: self$filter_taxa(sampled_rows, ...)
  5: private$parse_nse_taxon_subset(...)
  
  ── 17. Error: Sampling observations using data from subtaxa works (@test--taxmap
  'names' attribute [17] must be the same length as the vector [2]
  1: expect_equal({
         set.seed(1)
         sample_n_taxa(test_obj, size = 3, use_subtaxa = 0)
     }, {
         set.seed(1)
         sample_n_taxa(test_obj, size = 3, use_subtaxa = FALSE)
     }) at testthat/test--taxmap.R:536
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: sample_n_taxa(test_obj, size = 3, use_subtaxa = 0) at testthat/test--taxmap.R:538
  5: sample_n_taxa.Taxonomy(test_obj, size = 3, use_subtaxa = 0)
  6: obj$sample_n_taxa(...)
  7: self$filter_taxa(sampled_rows, ...)
  8: private$parse_nse_taxon_subset(...)
  
  ── 18. Error: Taxmap can be intialized from complex data (@test--taxmap_parsers.
  'names' attribute [9] must be the same length as the vector [2]
  1: expect_equal(length(vector_result$roots()), 1) at testthat/test--taxmap_parsers.R:25
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: vector_result$roots()
  5: private$parse_nse_taxon_subset(subset)
  
  ── 19. Error: Taxmap can be intialized from raw strings (@test--taxmap_parsers.R
  'names' attribute [8] must be the same length as the vector [2]
  1: extract_tax_data(raw_data, key = c(var_1 = "info", var_2 = "info", tax = "class"), 
         regex = "^>var_1:(.+)--var_2:(.+)--non_target--tax:(.+)$", class_sep = ";", class_regex = "^(.+)__(.+)$", 
         class_key = c(my_rank = "info", tax_name = "taxon_name")) at testthat/test--taxmap_parsers.R:147
  2: parse_tax_data(tax_data = parsed_input, class_cols = which(key == "class") + 1, class_sep = class_sep, 
         class_key = class_key, sep_is_regex = sep_is_regex, class_regex = class_regex, 
         include_match = include_match, include_tax_data = include_tax_data)
  3: unlist(lapply(output$supertaxa(output$input_ids, value = "taxon_ids", include_input = TRUE), 
         rev))
  4: lapply(output$supertaxa(output$input_ids, value = "taxon_ids", include_input = TRUE), 
         rev)
  5: output$supertaxa(output$input_ids, value = "taxon_ids", include_input = TRUE)
  6: private$parse_nse_taxon_subset(subset)
  
  ── 20. Error: Simple usage (@test--taxonomy.R#93)  ─────────────────────────────
  'names' attribute [9] must be the same length as the vector [2]
  1: expect_length(x$roots(), 1) at testthat/test--taxonomy.R:93
  2: quasi_label(enquo(object))
  3: eval_bare(get_expr(quo), get_env(quo))
  4: x$roots()
  5: private$parse_nse_taxon_subset(subset)
  
  ── 21. Error: Multiple roots (@test--taxonomy.R#101)  ──────────────────────────
  'names' attribute [14] must be the same length as the vector [2]
  1: expect_length(x$roots(), 2) at testthat/test--taxonomy.R:101
  2: quasi_label(enquo(object))
  3: eval_bare(get_expr(quo), get_env(quo))
  4: x$roots()
  5: private$parse_nse_taxon_subset(subset)
  
  ── 22. Error: Hierarchies of different lengths (@test--taxonomy.R#109)  ────────
  'names' attribute [5] must be the same length as the vector [2]
  1: expect_length(x$roots(), 1) at testthat/test--taxonomy.R:109
  2: quasi_label(enquo(object))
  3: eval_bare(get_expr(quo), get_env(quo))
  4: x$roots()
  5: private$parse_nse_taxon_subset(subset)
  
  ── 23. Error: Same taxon name, different lineage (@test--taxonomy.R#117)  ──────
  'names' attribute [4] must be the same length as the vector [2]
  1: expect_length(x$roots(), 2) at testthat/test--taxonomy.R:117
  2: quasi_label(enquo(object))
  3: eval_bare(get_expr(quo), get_env(quo))
  4: x$roots()
  5: private$parse_nse_taxon_subset(subset)
  
  ── 24. Error: Characters as inputs (@test--taxonomy.R#137)  ────────────────────
  'names' attribute [4] must be the same length as the vector [2]
  1: expect_length(x$roots(), 1) at testthat/test--taxonomy.R:137
  2: quasi_label(enquo(object))
  3: eval_bare(get_expr(quo), get_env(quo))
  4: x$roots()
  5: private$parse_nse_taxon_subset(subset)
  
  ── 25. Error: Finding roots (@test--taxonomy.R#146)  ───────────────────────────
  'names' attribute [16] must be the same length as the vector [2]
  1: expect_equal(x$roots(), roots(x)) at testthat/test--taxonomy.R:146
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: x$roots()
  5: private$parse_nse_taxon_subset(subset)
  
  ── 26. Error: Finding supertaxa (@test--taxonomy.R#159)  ───────────────────────
  'names' attribute [16] must be the same length as the vector [2]
  1: expect_equal(x$supertaxa(), supertaxa(x)) at testthat/test--taxonomy.R:159
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: x$supertaxa()
  5: private$parse_nse_taxon_subset(subset)
  
  ── 27. Error: Finding subtaxa (@test--taxonomy.R#179)  ─────────────────────────
  'names' attribute [16] must be the same length as the vector [2]
  1: expect_equal(x$subtaxa(), subtaxa(x)) at testthat/test--taxonomy.R:179
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: x$subtaxa()
  5: private$parse_nse_taxon_subset(subset)
  
  ── 28. Error: Finding stems (@test--taxonomy.R#206)  ───────────────────────────
  'names' attribute [16] must be the same length as the vector [2]
  1: expect_equal(x$stems(), stems(x)) at testthat/test--taxonomy.R:206
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: x$stems()
  5: private$parse_nse_taxon_subset(subset)
  
  ── 29. Error: Finding leaves (@test--taxonomy.R#221)  ──────────────────────────
  'names' attribute [16] must be the same length as the vector [2]
  1: expect_equal(x$leaves(), leaves(x)) at testthat/test--taxonomy.R:221
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: x$leaves()
  5: private$parse_nse_taxon_subset(subset)
  
  ── 30. Error: Filtering taxa (@test--taxonomy.R#235)  ──────────────────────────
  'names' attribute [16] must be the same length as the vector [2]
  1: filter_taxa(x, taxon_names == "Solanum") at testthat/test--taxonomy.R:235
  2: filter_taxa.Taxonomy(x, taxon_names == "Solanum")
  3: obj$filter_taxa(...)
  4: private$parse_nse_taxon_subset(...)
  
  ── 31. Error: Sampling taxa (@test--taxonomy.R#246)  ───────────────────────────
  'names' attribute [16] must be the same length as the vector [2]
  1: sample_n_taxa(x, size = 3) at testthat/test--taxonomy.R:246
  2: sample_n_taxa.Taxonomy(x, size = 3)
  3: obj$sample_n_taxa(...)
  4: self$filter_taxa(sampled_rows, ...)
  5: private$parse_nse_taxon_subset(...)
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 317 SKIPPED: 0 FAILED: 31
  1. Error: NSE values can be found (@test--taxmap.R#214) 
  2. Error: All valid NSE values can be found (@test--taxmap.R#224) 
  3. Error: Mapping between table observations and the edge list works (@test--taxmap.R#233) 
  4. Error: Mapping between a subset of observations and the edge list works (@test--taxmap.R#242) 
  5. Error: Mapping non-recursivly between observations and the edge list works (@test--taxmap.R#247) 
  6. Error: Mapping simplification between observations and the edge list works (@test--taxmap.R#253) 
  7. Error: Mapping observations in external tables (@test--taxmap.R#259) 
  8. Error: Default taxon filtering works (@test--taxmap.R#271) 
  9. Error: Subtaxa can be included when filtering taxa (@test--taxmap.R#279) 
  1. ...
  
  Error: testthat unit tests failed
  Execution halted