Running ‘testthat.R’ [17s/12s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(ume)
  > 
  > test_check("ume")
  Saving _problems/test-as_peaklist-123.R
  Saving _problems/test-assign_formulas-10.R
  Saving _problems/test-assign_formulas-16.R
  Saving _problems/test-assign_formulas-35.R
  Saving _problems/test-assign_formulas-47.R
  Saving _problems/test-calc_exact_mass-32.R
  Saving _problems/test-calc_nm-41.R
  Saving _problems/test-calc_number_assignments-10.R
  Saving _problems/test-calc_number_assignments-31.R
  Saving _problems/test-calc_number_assignments-39.R
  Saving _problems/test-convert_molecular_formula_to_data_table-6.R
  Saving _problems/test-eval_complete_pipeline_direct_infusion-11.R
  Saving _problems/test-eval_isotopes-9.R
  [ FAIL 13 | WARN 0 | SKIP 0 | PASS 216 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-as_peaklist.R:123:3'): as_peaklist() generates file_id based on 'file' column ──
  Error in ``[.data.table`(pl, , `:=`(file_id, .GRP), by = file)`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─ume::as_peaklist(pl) at test-as_peaklist.R:123:3
   2.   └─ume:::.prepare_peaklist_columns(pl)
   3.     ├─pl[, `:=`(file_id, .GRP), by = file]
   4.     └─data.table:::`[.data.table`(pl, , `:=`(file_id, .GRP), by = file)
  ── Error ('test-assign_formulas.R:8:3'): assign_formulas outputs warnings for peaks outside library mass range ──
  Error in ``[.data.table`(mfd, , `:=`(mf_id, .GRP), by = .(file_id, mf))`: attempt access index 20/20 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─testthat::expect_warning(...) at test-assign_formulas.R:8:3
   2. │ └─testthat:::expect_condition_matching_(...)
   3. │   └─testthat:::quasi_capture(...)
   4. │     ├─testthat (local) .capture(...)
   5. │     │ └─base::withCallingHandlers(...)
   6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   7. └─ume::assign_formulas(...)
   8.   ├─mfd[, `:=`(mf_id, .GRP), by = .(file_id, mf)]
   9.   └─data.table:::`[.data.table`(...)
  ── Error ('test-assign_formulas.R:15:3'): assign_formulas produces expected columns in the output ──
  Error in ``[.data.table`(mfd, , `:=`(mf_id, .GRP), by = .(file_id, mf))`: attempt access index 20/20 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─base::suppressMessages(...) at test-assign_formulas.R:15:3
   2. │ └─base::withCallingHandlers(...)
   3. ├─base::suppressWarnings(...)
   4. │ └─base::withCallingHandlers(...)
   5. └─ume::assign_formulas(...)
   6.   ├─mfd[, `:=`(mf_id, .GRP), by = .(file_id, mf)]
   7.   └─data.table:::`[.data.table`(...)
  ── Error ('test-assign_formulas.R:29:3'): assign_formulas returns expected row count for demo data ──
  Error in ``[.data.table`(mfd, , `:=`(mf_id, .GRP), by = .(file_id, mf))`: attempt access index 20/20 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─ume::assign_formulas(...) at test-assign_formulas.R:29:3
   2.   ├─mfd[, `:=`(mf_id, .GRP), by = .(file_id, mf)]
   3.   └─data.table:::`[.data.table`(...)
  ── Error ('test-assign_formulas.R:46:3'): assign_formulas returns expected row count for single mass vector ──
  Error in ``[.data.table`(mfd, , `:=`(mf_id, .GRP), by = .(file_id, mf))`: attempt access index 17/17 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─base::suppressMessages(...) at test-assign_formulas.R:46:3
   2. │ └─base::withCallingHandlers(...)
   3. └─ume::assign_formulas(...)
   4.   ├─mfd[, `:=`(mf_id, .GRP), by = .(file_id, mf)]
   5.   └─data.table:::`[.data.table`(...)
  ── Error ('test-calc_exact_mass.R:32:3'): (code run outside of `test_that()`) ──
  Error in ``[.data.table`(dt, , `:=`(mf, paste0(names(tapply(count, symbol, sum)), tapply(count, symbol, sum), collapse = "")), mf_iso)`: attempt access index 12/12 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─ume::calc_exact_mass(mfd = c("C2H4", "C2H4Cl")) at test-calc_exact_mass.R:32:3
   2.   └─ume::convert_molecular_formula_to_data_table(mfd)
   3.     ├─...[]
   4.     └─data.table:::`[.data.table`(...)
  ── Error ('test-calc_nm.R:41:3'): calc_nm correctly calculates nominal mass for molecular formulas ──
  Error in ``[.data.table`(dt, , `:=`(mf, paste0(names(tapply(count, symbol, sum)), tapply(count, symbol, sum), collapse = "")), mf_iso)`: attempt access index 12/12 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─ume::calc_nm(mfd = c("C2H4", "C2H4Cl")) at test-calc_nm.R:41:3
   2.   └─ume::convert_molecular_formula_to_data_table(mf = mfd)
   3.     ├─...[]
   4.     └─data.table:::`[.data.table`(...)
  ── Error ('test-calc_number_assignments.R:10:3'): calc_number_assignment returns correct counts ──
  Error in ``[.data.table`(dt, , `:=`(n_assignments, .N), by = .(ms_id, peak_id))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─ume::calc_number_assignment(...) at test-calc_number_assignments.R:10:3
   2.   ├─dt[, `:=`(n_assignments, .N), by = .(ms_id, peak_id)]
   3.   └─data.table:::`[.data.table`(...)
  ── Error ('test-calc_number_assignments.R:31:3'): calc_number_assignment returns integer vector ──
  Error in ``[.data.table`(dt, , `:=`(n_assignments, .N), by = .(ms_id, peak_id))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─ume::calc_number_assignment(...) at test-calc_number_assignments.R:31:3
   2.   ├─dt[, `:=`(n_assignments, .N), by = .(ms_id, peak_id)]
   3.   └─data.table:::`[.data.table`(...)
  ── Error ('test-calc_number_assignments.R:38:3'): calc_number_assignment warns about duplicate entries ──
  Error in ``[.data.table`(dt, , `:=`(n_assignments, .N), by = .(ms_id, peak_id))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─testthat::expect_warning(...) at test-calc_number_assignments.R:38:3
   2. │ └─testthat:::expect_condition_matching_(...)
   3. │   └─testthat:::quasi_capture(...)
   4. │     ├─testthat (local) .capture(...)
   5. │     │ └─base::withCallingHandlers(...)
   6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   7. └─ume::calc_number_assignment(...)
   8.   ├─dt[, `:=`(n_assignments, .N), by = .(ms_id, peak_id)]
   9.   └─data.table:::`[.data.table`(...)
  ── Error ('test-convert_molecular_formula_to_data_table.R:6:3'): convert_molecular_formula_to_data_table works correctly ──
  Error in ``[.data.table`(dt, , `:=`(mf, paste0(names(tapply(count, symbol, sum)), tapply(count, symbol, sum), collapse = "")), mf_iso)`: attempt access index 12/12 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─ume::convert_molecular_formula_to_data_table(molecular_formulas) at test-convert_molecular_formula_to_data_table.R:6:3
   2.   ├─...[]
   3.   └─data.table:::`[.data.table`(...)
  ── Error ('test-eval_complete_pipeline_direct_infusion.R:5:5'): Test the entire UME data pipeline ──
  Error in ``[.data.table`(mfd, , `:=`(mf_id, .GRP), by = .(file_id, mf))`: attempt access index 20/20 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─base::suppressWarnings(...) at test-eval_complete_pipeline_direct_infusion.R:5:5
   2. │ └─base::withCallingHandlers(...)
   3. └─ume::assign_formulas(...)
   4.   ├─mfd[, `:=`(mf_id, .GRP), by = .(file_id, mf)]
   5.   └─data.table:::`[.data.table`(...)
  ── Error ('test-eval_isotopes.R:3:5'): eval_isotopes reduces rows correctly when remove_isotopes = TRUE ──
  Error in ``[.data.table`(mfd, , `:=`(mf_id, .GRP), by = .(file_id, mf))`: attempt access index 20/20 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─base::suppressWarnings(...) at test-eval_isotopes.R:3:5
   2. │ └─base::withCallingHandlers(...)
   3. └─ume::ume_assign_formulas(...)
   4.   └─ume::assign_formulas(...)
   5.     ├─mfd[, `:=`(mf_id, .GRP), by = .(file_id, mf)]
   6.     └─data.table:::`[.data.table`(...)
  
  [ FAIL 13 | WARN 0 | SKIP 0 | PASS 216 ]
  Error:
  ! Test failures.
  Execution halted