Running ‘testthat.R’ [31s/37s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(tabxplor)
  > 
  > # # CRAN OMP THREAD LIMIT
  > # threads_option <- Sys.getenv("OMP_THREAD_LIMIT")
  > #Sys.setenv("OMP_THREAD_LIMIT" = 2)
  > 
  > 
  > 
  > test_check("tabxplor")
  Saving _problems/test-tab-99.R
  28 rows with zero or NA weights were removed
  Saving _problems/test-tab-158.R
  Saving _problems/test-tab-254.R
  Saving _problems/test-tab-273.R
  [1] "/tmp/Rtmp2HF8O4/tab_xl_test.xlsx"
  [1] "/tmp/Rtmp2HF8O4/tab_xl_test.xlsx"
  [ FAIL 4 | WARN 0 | SKIP 0 | PASS 190 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-tab.R:99:3'): tab_num works with missing, NULL, NA, etc. ───────
  Error in ``[.data.table`(tabs, , `:=`(paste0(col_vars, "_diff"), purrr::map(rlang::syms(paste0(col_vars, "_mean")), ~eval(.)/dplyr::nth(eval(.), tidyr::replace_na(which(eval(rlang::sym("ref_rows___")))[1], 0)))), by = eval(comp_group))`: attempt access index 9/9 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─... %>% testthat::expect_s3_class("tabxplor_tab") at test-tab.R:99:3
   2. ├─testthat::expect_s3_class(., "tabxplor_tab")
   3. │ └─testthat::quasi_label(enquo(object))
   4. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   5. └─tabxplor::tab_num(...)
   6.   ├─...[]
   7.   └─data.table:::`[.data.table`(...)
  ── Error ('test-tab.R:158:3'): tab_many works with numeric variables ───────────
  <purrr_error_indexed/rlang_error/error/condition>
  Error in `purrr::pmap(list(row_vars, totaltab, totrow, ref, comp, color_num, ci, na_num), ~tab_num(data, !!..1, as.character(col_vars)[col_vars_num], as.character(tab_vars), wt = !!wt, na = ..8, digits = digits[col_vars_num], ref = ..4, ci = ..7, conf_level = conf_level, comp = ..5, color = ..6, totaltab = ..2, totaltab_name = totaltab_name, tot = dplyr::if_else(..3, "row", "no"), total_names = total_names))`: i In index: 1.
  Caused by error in `[.data.table`:
  ! attempt access index 6/6 in VECTOR_ELT
  Backtrace:
       ▆
    1. ├─testthat::expect_s3_class(...) at test-tab.R:158:3
    2. │ └─testthat::quasi_label(enquo(object))
    3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
    4. ├─tabxplor::tab_many(data, sex, mass, gender)
    5. │ ├─... %>% purrr::set_names(row_vars)
    6. │ └─purrr::pmap(...)
    7. │   └─purrr:::pmap_("list", .l, .f, ..., .progress = .progress)
    8. │     ├─purrr:::with_indexed_errors(...)
    9. │     │ └─base::withCallingHandlers(...)
   10. │     ├─purrr:::call_with_cleanup(...)
   11. │     └─tabxplor (local) .f(...)
   12. │       └─tabxplor::tab_num(...)
   13. │         ├─...[]
   14. │         └─data.table:::`[.data.table`(...)
   15. ├─purrr::set_names(., row_vars)
   16. └─base::.handleSimpleError(...)
   17.   └─purrr (local) h(simpleError(msg, call))
   18.     └─cli::cli_abort(...)
   19.       └─rlang::abort(...)
  ── Error ('test-tab.R:247:3'): tab_many work with tribble ──────────────────────
  <purrr_error_indexed/rlang_error/error/condition>
  Error in `purrr::pmap(., tab_many, data = data, totcol = "no", totaltab = "no")`: i In index: 2.
  Caused by error in `purrr::pmap()`:
  i In index: 1.
  Caused by error in `[.data.table`:
  ! attempt access index 6/6 in VECTOR_ELT
  ── Error ('test-tab.R:266:3'): tab work with tribble (even many tab_vars) ──────
  <purrr_error_indexed/rlang_error/error/condition>
  Error in `purrr::pmap(., tab, data = data)`: i In index: 2.
  Caused by error in `purrr::pmap()`:
  i In index: 1.
  Caused by error in `[.data.table`:
  ! attempt access index 6/6 in VECTOR_ELT
  
  [ FAIL 4 | WARN 0 | SKIP 0 | PASS 190 ]
  Error:
  ! Test failures.
  Execution halted