Running ‘testthat.R’ [81s/96s]
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(whatifbandit)
  > 
  > test_check("whatifbandit")
  Saving _problems/test-mab_simulations-16.R
  Saving _problems/test-mab_simulations-41.R
  [ FAIL 2 | WARN 456 | SKIP 9 | PASS 364 ]
  
  ══ Skipped tests (9) ═══════════════════════════════════════════════════════════
  • On CRAN (9): 'test-error_validation.R:1:1', 'test-error_validation.R:29:1',
    'test-error_validation.R:106:1', 'test-error_validation.R:205:1',
    'test-error_validation.R:261:1',
    'test-mab_simulation_robust_type_columns.R:2:3',
    'test-mab_simulation_robust_type_columns.R:15:3',
    'test-tbl_dt_equality.R:2:3', 'test-tbl_dt_equality.R:17:3'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-mab_simulations.R:16:3'): data.table Single Simulation Test ────
  <purrr_error_indexed/rlang_error/error/condition>
  Error in `purrr::map(seq_len(nrow(full_args)), function(x) {     args <- c(as.list(full_args[x, ]), static_args)     expect_no_failure({         output <- do.call(eval(FUN), args)         testthat::capture_output_lines(expect_no_failure(print(output)))     })     if (isTRUE(args$time_unit == "Month")) {         args$data_cols <- args$data_cols[!names(args$data_cols) == "month_col"]         expect_no_failure(do.call(eval(FUN), args))     }     expect_s3_class(output, class)     expect_no_failure({         if (!eval(class_specific_checks)) {             stop("Post-Run Checks Failed")         }     })     return(output) })`: i In index: 1.
  Caused by error in `[.data.table`:
  ! attempt access index 4/4 in VECTOR_ELT
  Backtrace:
       ▆
    1. ├─whatifbandit:::run_test(full_args, static_args, trial = "single") at test-mab_simulations.R:16:3
    2. │ └─purrr::map(...) at ./helper.R:189:3
    3. │   └─purrr:::map_("list", .x, .f, ..., .progress = .progress)
    4. │     ├─purrr:::with_indexed_errors(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     ├─purrr:::call_with_cleanup(...)
    7. │     └─whatifbandit (local) .f(.x[[i]], ...)
    8. │       ├─testthat::expect_no_failure(...) at ./helper.R:191:5
    9. │       │ └─testthat:::capture_success_failure(expr)
   10. │       │   └─base::withCallingHandlers(...)
   11. │       ├─base::do.call(eval(FUN), args) at ./helper.R:192:7
   12. │       └─whatifbandit (local) `<fn>`(...)
   13. │         └─whatifbandit:::mab_simulation(...)
   14. │           ├─whatifbandit:::get_iaipw(...)
   15. │           └─whatifbandit:::get_iaipw.data.table(...)
   16. │             ├─...[]
   17. │             └─data.table:::`[.data.table`(...)
   18. └─base::.handleSimpleError(...)
   19.   └─purrr (local) h(simpleError(msg, call))
   20.     └─cli::cli_abort(...)
   21.       └─rlang::abort(...)
  ── Error ('test-mab_simulations.R:41:3'): data.table Multiple Simulation Test ──
  <purrr_error_indexed/rlang_error/error/condition>
  Error in `purrr::map(seq_len(nrow(full_args)), function(x) {     args <- c(as.list(full_args[x, ]), static_args)     expect_no_failure({         output <- do.call(eval(FUN), args)         testthat::capture_output_lines(expect_no_failure(print(output)))     })     if (isTRUE(args$time_unit == "Month")) {         args$data_cols <- args$data_cols[!names(args$data_cols) == "month_col"]         expect_no_failure(do.call(eval(FUN), args))     }     expect_s3_class(output, class)     expect_no_failure({         if (!eval(class_specific_checks)) {             stop("Post-Run Checks Failed")         }     })     return(output) })`: i In index: 1.
  Caused by error in `[.data.table`:
  ! attempt access index 4/4 in VECTOR_ELT
  Backtrace:
       ▆
    1. ├─whatifbandit:::run_test(full_args, static_args, trial = "multiple") at test-mab_simulations.R:41:3
    2. │ └─purrr::map(...) at ./helper.R:189:3
    3. │   └─purrr:::map_("list", .x, .f, ..., .progress = .progress)
    4. │     ├─purrr:::with_indexed_errors(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     ├─purrr:::call_with_cleanup(...)
    7. │     └─whatifbandit (local) .f(.x[[i]], ...)
    8. │       ├─testthat::expect_no_failure(...) at ./helper.R:191:5
    9. │       │ └─testthat:::capture_success_failure(expr)
   10. │       │   └─base::withCallingHandlers(...)
   11. │       ├─base::do.call(eval(FUN), args) at ./helper.R:192:7
   12. │       └─whatifbandit (local) `<fn>`(...)
   13. │         └─whatifbandit:::pre_mab_simulation(...)
   14. │           ├─whatifbandit:::imputation_precompute(...)
   15. │           └─whatifbandit:::imputation_precompute.data.table(...)
   16. │             ├─...[]
   17. │             └─data.table:::`[.data.table`(...)
   18. └─base::.handleSimpleError(...)
   19.   └─purrr (local) h(simpleError(msg, call))
   20.     └─cli::cli_abort(...)
   21.       └─rlang::abort(...)
  
  [ FAIL 2 | WARN 456 | SKIP 9 | PASS 364 ]
  Error:
  ! Test failures.
  Execution halted