Package: riskRegression Check: tests New result: ERROR Running ‘testthat.R’ [25s/24s] 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") [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 Saving _problems/test-phreg-45.R Saving _problems/test-phreg-60.R Saving _problems/test-phreg-84.R Saving _problems/test-phreg-113.R Saving _problems/test-phreg-125.R Saving _problems/test-phreg-136.R [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 [1] "binary" [1] "survival" [1] "competing.risks" [ FAIL 6 | WARN 1 | SKIP 0 | PASS 448 ] ══ Failed tests ════════════════════════════════════════════════════════════════ ── Error ('test-phreg.R:45:5'): survival - no strata ─────────────────────────── Error in `colnamesInt(x, neworder, check_dups = FALSE, skip_absent = skip_absent)`: argument specifying columns received non-existing column(s): cols[2]='stop' Backtrace: ▆ 1. ├─testthat::expect_equal(...) at test-phreg.R:45:5 2. │ └─testthat::quasi_label(enquo(object), label) 3. │ └─rlang::eval_bare(expr, quo_get_env(quo)) 4. └─riskRegression::predictCox(m.phreg, center = FALSE) 5. ├─riskRegression::coxModelFrame(object) 6. └─riskRegression:::coxModelFrame.phreg(object) 7. └─data.table::setcolorder(dt, c(first.col, setdiff(names(dt), first.col))) 8. └─data.table:::colnamesInt(x, neworder, check_dups = FALSE, skip_absent = skip_absent) ── Error ('test-phreg.R:60:5'): survival - one strata variable ───────────────── Error in `colnamesInt(x, neworder, check_dups = FALSE, skip_absent = skip_absent)`: argument specifying columns received non-existing column(s): cols[2]='stop' Backtrace: ▆ 1. ├─testthat::expect_equal(...) at test-phreg.R:60:5 2. │ └─testthat::quasi_label(enquo(object), label) 3. │ └─rlang::eval_bare(expr, quo_get_env(quo)) 4. └─riskRegression::predictCox(mS.phreg, center = FALSE) 5. ├─riskRegression::coxModelFrame(object) 6. └─riskRegression:::coxModelFrame.phreg(object) 7. └─data.table::setcolorder(dt, c(first.col, setdiff(names(dt), first.col))) 8. └─data.table:::colnamesInt(x, neworder, check_dups = FALSE, skip_absent = skip_absent) ── Error ('test-phreg.R:82:5'): survival - several strata variables ──────────── Error in `colnamesInt(x, neworder, check_dups = FALSE, skip_absent = skip_absent)`: argument specifying columns received non-existing column(s): cols[2]='stop' Backtrace: ▆ 1. ├─testthat::expect_equal(...) at test-phreg.R:82:5 2. │ └─testthat::quasi_label(enquo(object), label) 3. │ └─rlang::eval_bare(expr, quo_get_env(quo)) 4. └─riskRegression::predictCox(mS.phreg, center = FALSE) 5. ├─riskRegression::coxModelFrame(object) 6. └─riskRegression:::coxModelFrame.phreg(object) 7. └─data.table::setcolorder(dt, c(first.col, setdiff(names(dt), first.col))) 8. └─data.table:::colnamesInt(x, neworder, check_dups = FALSE, skip_absent = skip_absent) ── Error ('test-phreg.R:113:5'): competing risk - no strata ──────────────────── Error in `colnamesInt(x, neworder, check_dups = FALSE, skip_absent = skip_absent)`: argument specifying columns received non-existing column(s): cols[2]='stop' Backtrace: ▆ 1. ├─stats::predict(...) at test-phreg.R:113:5 2. └─riskRegression:::predict.CauseSpecificCox(...) 3. └─riskRegression:::compressData(...) 4. └─base::lapply(...) 5. └─riskRegression (local) FUN(X[[i]], ...) 6. ├─riskRegression::coxVariableName(iO, model.frame = coxModelFrame(iO)) 7. │ ├─stats::delete.response(...) 8. │ ├─stats::terms(ff, special = unlist(special.object), data = model.frame) 9. │ └─stats::terms.formula(ff, special = unlist(special.object), data = model.frame) 10. ├─riskRegression::coxModelFrame(iO) 11. └─riskRegression:::coxModelFrame.phreg(iO) 12. └─data.table::setcolorder(dt, c(first.col, setdiff(names(dt), first.col))) 13. └─data.table:::colnamesInt(x, neworder, check_dups = FALSE, skip_absent = skip_absent) ── Error ('test-phreg.R:125:5'): competing risk - one strata variable ────────── Error in `colnamesInt(x, neworder, check_dups = FALSE, skip_absent = skip_absent)`: argument specifying columns received non-existing column(s): cols[2]='stop' Backtrace: ▆ 1. ├─stats::predict(...) at test-phreg.R:125:5 2. └─riskRegression:::predict.CauseSpecificCox(...) 3. └─riskRegression:::compressData(...) 4. └─base::lapply(...) 5. └─riskRegression (local) FUN(X[[i]], ...) 6. ├─riskRegression::coxVariableName(iO, model.frame = coxModelFrame(iO)) 7. │ ├─stats::delete.response(...) 8. │ ├─stats::terms(ff, special = unlist(special.object), data = model.frame) 9. │ └─stats::terms.formula(ff, special = unlist(special.object), data = model.frame) 10. ├─riskRegression::coxModelFrame(iO) 11. └─riskRegression:::coxModelFrame.phreg(iO) 12. └─data.table::setcolorder(dt, c(first.col, setdiff(names(dt), first.col))) 13. └─data.table:::colnamesInt(x, neworder, check_dups = FALSE, skip_absent = skip_absent) ── Error ('test-phreg.R:136:5'): competing risk - several strata variables ───── Error in `colnamesInt(x, neworder, check_dups = FALSE, skip_absent = skip_absent)`: argument specifying columns received non-existing column(s): cols[2]='stop' Backtrace: ▆ 1. ├─stats::predict(...) at test-phreg.R:136:5 2. └─riskRegression:::predict.CauseSpecificCox(...) 3. └─riskRegression:::compressData(...) 4. └─base::lapply(...) 5. └─riskRegression (local) FUN(X[[i]], ...) 6. ├─riskRegression::coxVariableName(iO, model.frame = coxModelFrame(iO)) 7. │ ├─stats::delete.response(...) 8. │ ├─stats::terms(ff, special = unlist(special.object), data = model.frame) 9. │ └─stats::terms.formula(ff, special = unlist(special.object), data = model.frame) 10. ├─riskRegression::coxModelFrame(iO) 11. └─riskRegression:::coxModelFrame.phreg(iO) 12. └─data.table::setcolorder(dt, c(first.col, setdiff(names(dt), first.col))) 13. └─data.table:::colnamesInt(x, neworder, check_dups = FALSE, skip_absent = skip_absent) [ FAIL 6 | WARN 1 | SKIP 0 | PASS 448 ] Error: ! Test failures. Execution halted