Running ‘testthat.R’
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(CB2)
  > 
  > test_check("CB2")
  Detects the length of guided RNA is 20
  25 gRNAs were found from the gRNA_Reference library.
  All 1730 were proceed!
  Detects the length of guided RNA is 20
  25 gRNAs were found from the gRNA_Reference library.
  All 2001 were proceed!
  Detects the length of guided RNA is 20
  25 gRNAs were found from the gRNA_Reference library.
  All 703 were proceed!
  Detects the length of guided RNA is 20
  25 gRNAs were found from the gRNA_Reference library.
  All 659 were proceed!
  Detects the length of guided RNA is 20
  25 gRNAs were found from the gRNA_Reference library.
  All 688 were proceed!
  Detects the length of guided RNA is 20
  25 gRNAs were found from the gRNA_Reference library.
  All 608 were proceed!
  ── 1. Error: A very simple sanity check (@test.toydata.R#34)  ──────────────────
  could not find function "n"
  1: expect_length(measure_gene_stats(sgstat), 11) at testthat/test.toydata.R:34
  2: quasi_label(enquo(object))
  3: eval_bare(get_expr(quo), get_env(quo))
  4: measure_gene_stats(sgstat)
  5: sgrna_stat %>% dplyr::group_by_(~gene) %>% dplyr::summarise_(n_sgrna = ~n(), cpm_a = ~mean(cpm_a), 
         cpm_b = ~mean(cpm_b), logFC = ~mean(logFC), p_ts = ~ifelse(n() > 1, metap::sumlog(p_ts)$p, 
             sum(p_ts)), p_pa = ~ifelse(n() > 1, metap::sumlog(p_pa)$p, sum(p_pa)), p_pb = ~ifelse(n() > 
             1, metap::sumlog(p_pb)$p, sum(p_pb))) %>% dplyr::ungroup() %>% dplyr::mutate_(fdr_ts = ~p.adjust(p_ts, 
         method = "fdr"), fdr_pa = ~p.adjust(p_pa, method = "fdr"), fdr_pb = ~p.adjust(p_pb, 
         method = "fdr"))
  6: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  7: eval(quote(`_fseq`(`_lhs`)), env, env)
  8: eval(quote(`_fseq`(`_lhs`)), env, env)
  9: `_fseq`(`_lhs`)
  10: freduce(value, `_function_list`)
  11: function_list[[i]](value)
  12: dplyr::summarise_(., n_sgrna = ~n(), cpm_a = ~mean(cpm_a), cpm_b = ~mean(cpm_b), 
         logFC = ~mean(logFC), p_ts = ~ifelse(n() > 1, metap::sumlog(p_ts)$p, sum(p_ts)), 
         p_pa = ~ifelse(n() > 1, metap::sumlog(p_pa)$p, sum(p_pa)), p_pb = ~ifelse(n() > 
             1, metap::sumlog(p_pb)$p, sum(p_pb)))
  13: summarise_.tbl_df(., n_sgrna = ~n(), cpm_a = ~mean(cpm_a), cpm_b = ~mean(cpm_b), 
         logFC = ~mean(logFC), p_ts = ~ifelse(n() > 1, metap::sumlog(p_ts)$p, sum(p_ts)), 
         p_pa = ~ifelse(n() > 1, metap::sumlog(p_pa)$p, sum(p_pa)), p_pb = ~ifelse(n() > 
             1, metap::sumlog(p_pb)$p, sum(p_pb)))
  14: summarise_impl(.data, dots, environment(), caller_env())
  15: ifelse(n() > 1, metap::sumlog(p_ts)$p, sum(p_ts))
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 6 SKIPPED: 0 FAILED: 1
  1. Error: A very simple sanity check (@test.toydata.R#34) 
  
  Error: testthat unit tests failed
  Execution halted