Running ‘testthat.R’ [44s/46s]
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/tests.html
  > # * https://testthat.r-lib.org/reference/test_package.html#special-files
  > 
  > library(testthat)
  > library(riskRegression)
  riskRegression version 2025.09.17
  > 
  > test_check("riskRegression")
  Saving _problems/test-AUC-13.R
  Saving _problems/test-BrierScore-14.R
  [iidCox] internal consistency 
  [iidCox] compare to timereg - no strata, no interaction, continuous 
  [iidCox] compare to timereg - no strata, interaction, continuous 
  [iidCox] compare to timereg - no covariate 
  [iidCox] compare to timereg - no strata, no interaction, categorical 
  [iidCox] compare to timereg - ties 
  [iidCox] compare to timereg - strata 
  [iidCox] compare to timereg - Melanoma 
  [predictCox] Estimation of the baseline hazard (no strata) 
  [predictCox] Estimation of the baseline hazard (strata) 
  [predictCox] Estimation of the baseline hazard (time varying cov, no strata) 
  [predictCox] Estimation of the baseline hazard (time varying cov, strata) 
  [predictCox] Predictions (no strata, continuous) 
  [predictCox] Predictions (no strata, categorical) 
  [predictCox] Predictions (strata) 
  [predictCox] SE/CI check against manual computation 
  [predictCox] Argument 'diag' 
  [predictCox] Confidence band vs timereg 
  [predictCox] Check same result store.iid=minimal vs. full 
  [predictCox] Does not handle weights 
  [predictCox] dealing with negative timepoints or NA 
  [predictCox] Previous bug 
  [predictRisk.rfsrc]  
  [predictRisk.CauseSpecificCox] 
  [predictRisk.glm] vs. lava 
  Saving _problems/test-score-train-test-42.R
  Saving _problems/test-score-train-test-42.R
  Saving _problems/test-score-38.R
  Saving _problems/test-score-92.R
  Saving _problems/test-score-119.R
  Saving _problems/test-score-149.R
  [1] "binary"
  [1] "survival"
  Saving _problems/test-summary-score-44.R
  [ FAIL 9 | WARN 0 | SKIP 0 | PASS 371 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-AUC.R:13:5'): AUC censored data: order ─────────────────────────
  Error in ``[.data.table`(aucDT, , `:=`(TPR, cumsum(ipcwCases)/sum(ipcwCases)), by = list(model, times))`: attempt access index 12/12 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─base::suppressWarnings(...) at test-AUC.R:13:5
   2. │ └─base::withCallingHandlers(...)
   3. ├─riskRegression::Score(...)
   4. └─riskRegression::Score.list(...)
   5.   └─riskRegression:::computePerformance(...)
   6.     ├─base::do.call(paste(m, response.type, sep = "."), input)
   7.     └─riskRegression:::AUC.survival(...)
   8.       ├─...[]
   9.       └─data.table:::`[.data.table`(...)
  ── Error ('test-BrierScore.R:14:5'): Brier score censored data order ───────────
  Error in ``[.data.table`(DT, , `:=`(IC0, residuals - mean(residuals)), by = list(model, times))`: attempt access index 10/10 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─riskRegression::Score(...) at test-BrierScore.R:14:5
   2. └─riskRegression::Score.list(...)
   3.   └─riskRegression:::computePerformance(...)
   4.     ├─base::do.call(paste(m, response.type, sep = "."), input)
   5.     └─riskRegression:::Brier.survival(...)
   6.       ├─...[]
   7.       └─data.table:::`[.data.table`(...)
  ── Error ('test-score-train-test.R:42:7'): Survival outcome ────────────────────
  Error in ``[.data.table`(DT, , `:=`(IC0, residuals - mean(residuals)), by = list(model, times))`: attempt access index 10/10 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─base::do.call(Score, input.score) at test-score-train-test.R:42:7
   2. ├─riskRegression (local) `<fn>`(...)
   3. └─riskRegression::Score.list(...)
   4.   └─riskRegression:::computePerformance(...)
   5.     ├─base::do.call(paste(m, response.type, sep = "."), input)
   6.     └─riskRegression:::Brier.survival(...)
   7.       ├─...[]
   8.       └─data.table:::`[.data.table`(...)
  ── Error ('test-score-train-test.R:42:7'): Competing risks outcome ─────────────
  Error in ``[.data.table`(DT, , `:=`(IC0, residuals - mean(residuals)), by = list(model, times))`: attempt access index 11/11 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─base::do.call(Score, input.score) at test-score-train-test.R:42:7
   2. ├─riskRegression (local) `<fn>`(...)
   3. └─riskRegression::Score.list(...)
   4.   └─riskRegression:::computePerformance(...)
   5.     ├─base::do.call(paste(m, response.type, sep = "."), input)
   6.     └─riskRegression:::Brier.competing.risks(...)
   7.       ├─...[]
   8.       └─data.table:::`[.data.table`(...)
  ── Error ('test-score.R:38:3'): R squared/IPA ──────────────────────────────────
  Error in ``[.data.table`(DT, , `:=`(Brier, sum(residuals)/N), by = list(model))`: attempt access index 5/5 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─riskRegression::Score(...) at test-score.R:38:3
   2. └─riskRegression::Score.list(...)
   3.   └─riskRegression:::computePerformance(...)
   4.     ├─base::do.call(paste(m, response.type, sep = "."), input)
   5.     └─riskRegression:::Brier.binary(...)
   6.       ├─DT[, `:=`(Brier, sum(residuals)/N), by = list(model)]
   7.       └─data.table:::`[.data.table`(...)
  ── Error ('test-score.R:92:9'): survival outcome,Brier Score, external prediction ──
  Error in ``[.data.table`(aucDT, , `:=`(TPR, cumsum(ipcwCases)/sum(ipcwCases)), by = list(model, times))`: attempt access index 13/13 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─riskRegression::Score(...) at test-score.R:92:9
   2. └─riskRegression::Score.list(...)
   3.   └─riskRegression:::computePerformance(...)
   4.     ├─base::do.call(paste(m, response.type, sep = "."), input)
   5.     └─riskRegression:::AUC.survival(...)
   6.       ├─...[]
   7.       └─data.table:::`[.data.table`(...)
  ── Error ('test-score.R:115:9'): integrated Brier score ────────────────────────
  Error in ``[.data.table`(aucDT, , `:=`(TPR, cumsum(ipcwCases)/sum(ipcwCases)), by = list(model, times))`: attempt access index 13/13 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─base::suppressWarnings(...) at test-score.R:115:9
   2. │ └─base::withCallingHandlers(...)
   3. ├─riskRegression::Score(...)
   4. └─riskRegression::Score.list(...)
   5.   └─riskRegression:::computePerformance(...)
   6.     ├─base::do.call(paste(m, response.type, sep = "."), input)
   7.     └─riskRegression:::AUC.survival(...)
   8.       ├─...[]
   9.       └─data.table:::`[.data.table`(...)
  ── Error ('test-score.R:149:9'): survival outcome uncensored ───────────────────
  Error in ``[.data.table`(out[["Brier"]][["score"]], , `:=`(IBS, sapply(times, function(t) {     Dint(x = c(0, times), y = c(0, Brier), range = c(0, t)) })), by = c("model"))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─riskRegression::Score(...) at test-score.R:149:9
   2. └─riskRegression::Score.list(...)
   3.   └─riskRegression:::computePerformance(...)
   4.     ├─...[]
   5.     └─data.table:::`[.data.table`(...)
  ── Error ('test-summary-score.R:44:5'): (code run outside of `test_that()`) ────
  Error in ``[.data.table`(DT, , `:=`(IC0, residuals - mean(residuals)), by = list(model, times))`: attempt access index 10/10 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─riskRegression::Score(...) at test-summary-score.R:44:5
   2. └─riskRegression::Score.list(...)
   3.   └─riskRegression:::computePerformance(...)
   4.     ├─base::do.call(paste(m, response.type, sep = "."), input)
   5.     └─riskRegression:::Brier.survival(...)
   6.       ├─...[]
   7.       └─data.table:::`[.data.table`(...)
  
  [ FAIL 9 | WARN 0 | SKIP 0 | PASS 371 ]
  Error:
  ! Test failures.
  Execution halted