Running ‘testthat.R’ [7s/9s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > # This file is part of the standard setup for testthat.
  > # It is recommended that you do not modify it.
  > #
  > # Where should you do additional test configuration?
  > # Learn more about the roles of various files in:
  > # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
  > # * https://testthat.r-lib.org/articles/special-files.html
  > 
  > library(testthat)
  > library(cubar)
  > 
  > test_check("cubar")
  Saving _problems/test-codon_diff-5.R
  Saving _problems/test-est_rscu-2.R
  Saving _problems/test-est_rscu-8.R
  Saving _problems/test-est_rscu-14.R
  Saving _problems/test-est_rscu-23.R
  Saving _problems/test-get_cai-4.R
  Saving _problems/test-get_gc3s-4.R
  Saving _problems/test-get_gc4d-9.R
  [ FAIL 8 | WARN 0 | SKIP 0 | PASS 60 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-codon_diff.R:5:5'): differential testing are correct ───────────
  Error in ``[.data.table`(codon_table, , `:=`(c("global_or", "global_p"), {     m <- matrix(c(cnt1, global_other1, cnt2, global_other2), ncol = 2)     ft <- stats::fisher.test(m)     list(global_or = ft$estimate, global_p = ft$p.value) }), by = .(codon))`: attempt access index 8/8 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─cubar::codon_diff(x, y) at test-codon_diff.R:5:5
   2.   ├─...[]
   3.   └─data.table:::`[.data.table`(...)
  ── Error ('test-est_rscu.R:2:5'): est_rscu works for internal dataset yeast_cds ──
  Error in ``[.data.table`(codon_table, , `:=`(prop = (cts + pseudo_cnt)/sum(cts + pseudo_cnt), w_cai = (cts + pseudo_cnt)/max(cts + pseudo_cnt)), by = level)`: attempt access index 5/5 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─cubar::est_rscu(count_codons(yeast_cds)) at test-est_rscu.R:2:5
   2.   ├─...[]
   3.   └─data.table:::`[.data.table`(...)
  ── Error ('test-est_rscu.R:8:5'): empty codon frequency matrix ─────────────────
  Error in ``[.data.table`(codon_table, , `:=`(prop = (cts + pseudo_cnt)/sum(cts + pseudo_cnt), w_cai = (cts + pseudo_cnt)/max(cts + pseudo_cnt)), by = level)`: attempt access index 5/5 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─testthat::expect_equal(nrow(est_rscu(matrix())), 61) at test-est_rscu.R:8:5
   2. │ └─testthat::quasi_label(enquo(object), label)
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. ├─base::nrow(est_rscu(matrix()))
   5. └─cubar::est_rscu(matrix())
   6.   ├─...[]
   7.   └─data.table:::`[.data.table`(...)
  ── Error ('test-est_rscu.R:14:5'): sequence with strong bias ───────────────────
  Error in ``[.data.table`(codon_table, , `:=`(prop = (cts + pseudo_cnt)/sum(cts + pseudo_cnt), w_cai = (cts + pseudo_cnt)/max(cts + pseudo_cnt)), by = level)`: attempt access index 5/5 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─cubar::est_rscu(count_codons(seqs)) at test-est_rscu.R:14:5
   2.   ├─...[]
   3.   └─data.table:::`[.data.table`(...)
  ── Error ('test-est_rscu.R:23:5'): sequence with no bias ───────────────────────
  Error in ``[.data.table`(codon_table, , `:=`(prop = (cts + pseudo_cnt)/sum(cts + pseudo_cnt), w_cai = (cts + pseudo_cnt)/max(cts + pseudo_cnt)), by = level)`: attempt access index 5/5 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─cubar::est_rscu(count_codons(seqs)) at test-est_rscu.R:23:5
   2.   ├─...[]
   3.   └─data.table:::`[.data.table`(...)
  ── Error ('test-get_cai.R:4:5'): CAI = 1 for a reference with no bias ──────────
  Error in ``[.data.table`(codon_table, , `:=`(prop = (cts + pseudo_cnt)/sum(cts + pseudo_cnt), w_cai = (cts + pseudo_cnt)/max(cts + pseudo_cnt)), by = level)`: attempt access index 5/5 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─cubar::est_rscu(cf) at test-get_cai.R:4:5
   2.   ├─...[]
   3.   └─data.table:::`[.data.table`(...)
  ── Error ('test-get_gc3s.R:4:5'): return correct results ───────────────────────
  Error in ``[.data.table`(codon_table, , `:=`(ss, .N), by = level)`: attempt access index 4/4 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─testthat::expect_equal(get_gc3s(cf), c(0, 1, 0, 0.5)) at test-get_gc3s.R:4:5
   2. │ └─testthat::quasi_label(enquo(object), label)
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─cubar::get_gc3s(cf)
   5.   ├─codon_table[, `:=`(ss, .N), by = level]
   6.   └─data.table:::`[.data.table`(codon_table, , `:=`(ss, .N), by = level)
  ── Error ('test-get_gc4d.R:9:5'): return correct results ───────────────────────
  Error in ``[.data.table`(codon_table, , `:=`(ss, .N), by = level)`: attempt access index 4/4 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─testthat::expect_equal(get_gc4d(cf), c(0.5, NA, NA, 0.5)) at test-get_gc4d.R:9:5
   2. │ └─testthat::quasi_label(enquo(object), label)
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─cubar::get_gc4d(cf)
   5.   ├─codon_table[, `:=`(ss, .N), by = level]
   6.   └─data.table:::`[.data.table`(codon_table, , `:=`(ss, .N), by = level)
  
  [ FAIL 8 | WARN 0 | SKIP 0 | PASS 60 ]
  Error:
  ! Test failures.
  Execution halted