Running ‘testthat.R’ [28s/31s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(hesim)
  > 
  > test_check("hesim")
  Saving _problems/test-cpp-distributions-103.R
  Saving _problems/test-ctstm-215.R
  Saving _problems/test-ctstm-271.R
  Saving _problems/test-ctstm-309.R
  Saving _problems/test-ctstm-387.R
  Saving _problems/test-ctstm-392.R
  sample = 1
  sample = 2
  Saving _problems/test-ctstm-595.R
  [ FAIL 7 | WARN 0 | SKIP 0 | PASS 1095 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Failure ('test-cpp-distributions.R:100:1'): (code run outside of `test_that()`) ──
  `new(PwExp, rate = c(1, 2), time = c(0, 2, 4))` threw an error with unexpected message.
  Expected match: "'time' and 'rate' must be the same length."
  Actual message: "object 'PwExp' not found"
  Backtrace:
      ▆
   1. ├─testthat::expect_error(...) at test-cpp-distributions.R:100:1
   2. │ └─testthat:::quasi_capture(...)
   3. │   ├─testthat (local) .capture(...)
   4. │   │ └─base::withCallingHandlers(...)
   5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   6. └─methods::new(PwExp, rate = c(1, 2), time = c(0, 2, 4))
   7.   └─methods::getClass(Class, where = topenv(parent.frame()))
   8.     └─methods::getClassDef(Class, where)
   9.       └─methods:::.getClassesFromCache(Class)
  ── Error ('test-ctstm.R:215:3'): IndivCtstmTrans - transition specific ─────────
  Error in ``[.data.table`(disprog, , `:=`(strategy_index, .GRP), by = "strategy_id")`: attempt access index 9/9 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─mstate_list$sim_stateprobs(t = c(0, 1, 2, 3)) at test-ctstm.R:215:3
   2.   └─hesim:::indiv_ctstm_sim_stateprobs(disprog, self, t)
   3.     ├─disprog[, `:=`(strategy_index, .GRP), by = "strategy_id"]
   4.     └─data.table:::`[.data.table`(...)
  ── Error ('test-ctstm.R:271:3'): IndivCtstmTrans - joint ───────────────────────
  Error in ``[.data.table`(disprog, , `:=`(strategy_index, .GRP), by = "strategy_id")`: attempt access index 9/9 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─testthat::expect_true(...) at test-ctstm.R:271:3
   2. │ └─testthat::quasi_label(enquo(object), label)
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. ├─base::inherits(mstate$sim_stateprobs(t = c(0, 1, 2)), "data.table")
   5. └─mstate$sim_stateprobs(t = c(0, 1, 2))
   6.   └─hesim:::indiv_ctstm_sim_stateprobs(disprog, self, t)
   7.     ├─disprog[, `:=`(strategy_index, .GRP), by = "strategy_id"]
   8.     └─data.table:::`[.data.table`(...)
  ── Error ('test-ctstm.R:309:3'): Simulate disease progression with transition specific models ──
  Error in ``[.data.table`(disprog, , `:=`(strategy_index, .GRP), by = "strategy_id")`: attempt access index 9/9 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─ictstm$sim_stateprobs(t = c(0, 1, 2, 3)) at test-ctstm.R:309:3
   2.   └─hesim:::indiv_ctstm_sim_stateprobs(...)
   3.     ├─disprog[, `:=`(strategy_index, .GRP), by = "strategy_id"]
   4.     └─data.table:::`[.data.table`(...)
  ── Failure ('test-ctstm.R:387:3'): Simulate costs and QALYs ────────────────────
  `ictstm$sim_qalys(dr = 0.03)$qalys_` threw an error.
  Message: attempt access index 9/9 in VECTOR_ELT
  Class:   simpleError/error/condition
  Backtrace:
      ▆
   1. ├─testthat::expect_error(ictstm$sim_qalys(dr = 0.03)$qalys_, NA) at test-ctstm.R:387:3
   2. │ └─testthat:::quasi_capture(...)
   3. │   ├─testthat (local) .capture(...)
   4. │   │ └─base::withCallingHandlers(...)
   5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   6. └─ictstm$sim_qalys(dr = 0.03)
   7.   └─private$sim_ev(...)
   8.     ├─self$disprog_[, `:=`(strategy_idx, .GRP), by = "strategy_id"]
   9.     └─data.table:::`[.data.table`(...)
  ── Error ('test-ctstm.R:392:3'): Simulate costs and QALYs ──────────────────────
  Error in ``[.data.table`(self$disprog_, , `:=`(strategy_idx, .GRP), by = "strategy_id")`: attempt access index 9/9 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─ictstm$sim_qalys(dr = 0.03, by_patient = TRUE) at test-ctstm.R:392:3
   2.   └─private$sim_ev(...)
   3.     ├─self$disprog_[, `:=`(strategy_idx, .GRP), by = "strategy_id"]
   4.     └─data.table:::`[.data.table`(...)
  ── Error ('test-ctstm.R:595:3'): IndivCtstm - joint ────────────────────────────
  Error in ``[.data.table`(disprog, , `:=`(strategy_index, .GRP), by = "strategy_id")`: attempt access index 9/9 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─ictstm$sim_stateprobs(t = c(0, 1, 2, 3)) at test-ctstm.R:595:3
   2.   └─hesim:::indiv_ctstm_sim_stateprobs(...)
   3.     ├─disprog[, `:=`(strategy_index, .GRP), by = "strategy_id"]
   4.     └─data.table:::`[.data.table`(...)
  
  [ FAIL 7 | WARN 0 | SKIP 0 | PASS 1095 ]
  Error:
  ! Test failures.
  Execution halted