- using R Under development (unstable) (2025-12-18 r89199)
- using platform: x86_64-pc-linux-gnu
- R was compiled by
Debian clang version 21.1.7 (1)
Debian flang version 21.1.7 (1)
- running under: Debian GNU/Linux forky/sid
- using session charset: UTF-8
- checking for file ‘hesim/DESCRIPTION’ ... OK
- checking extension type ... Package
- this is package ‘hesim’ version ‘0.5.7’
- checking CRAN incoming feasibility ... [2s/4s] OK
- checking package namespace information ... OK
- checking package dependencies ... OK
- checking if this is a source package ... OK
- checking if there is a namespace ... OK
- checking for executable files ... OK
- checking for hidden files and directories ... OK
- checking for portable file names ... OK
- checking for sufficient/correct file permissions ... OK
- checking whether package ‘hesim’ can be installed ... WARNING
Found the following significant warnings:
Warning: src/Makevars: Unknown C++ standard ‘C++11’ was ignored
See the install log for details.
- used C++ compiler: ‘Debian clang version 21.1.7 (1)’
- checking package directory ... OK
- checking for future file timestamps ... OK
- checking ‘build’ directory ... OK
- checking DESCRIPTION meta-information ... OK
- checking top-level files ... OK
- checking for left-over files ... OK
- checking index information ... OK
- checking package subdirectories ... OK
- checking code files for non-ASCII characters ... OK
- checking R files for syntax errors ... OK
- checking whether the package can be loaded ... [2s/3s] OK
- checking whether the package can be loaded with stated dependencies ... [2s/2s] OK
- checking whether the package can be unloaded cleanly ... [2s/3s] OK
- checking whether the namespace can be loaded with stated dependencies ... [2s/2s] OK
- checking whether the namespace can be unloaded cleanly ... [2s/3s] OK
- checking loading without being on the library search path ... [2s/3s] OK
- checking use of S3 registration ... OK
- checking dependencies in R code ... OK
- checking S3 generic/method consistency ... OK
- checking replacement functions ... OK
- checking foreign function calls ... OK
- checking R code for possible problems ... [26s/36s] OK
- checking Rd files ... [1s/2s] OK
- checking Rd metadata ... OK
- checking Rd line widths ... OK
- checking Rd cross-references ... OK
- checking for missing documentation entries ... OK
- checking for code/documentation mismatches ... OK
- checking Rd \usage sections ... OK
- checking Rd contents ... OK
- checking for unstated dependencies in examples ... OK
- checking contents of ‘data’ directory ... OK
- checking data for non-ASCII characters ... [0s/1s] OK
- checking LazyData ... OK
- checking data for ASCII and uncompressed saves ... OK
- checking line endings in C/C++/Fortran sources/headers ... OK
- checking line endings in Makefiles ... OK
- checking compilation flags in Makevars ... OK
- checking for GNU extensions in Makefiles ... OK
- checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS) ... OK
- checking use of PKG_*FLAGS in Makefiles ... OK
- checking use of SHLIB_OPENMP_*FLAGS in Makefiles ... OK
- checking pragmas in C/C++ headers and code ... OK
- checking compilation flags used ... OK
- checking compiled code ... OK
- checking installed files from ‘inst/doc’ ... OK
- checking files in ‘vignettes’ ... OK
- checking examples ... [8s/8s] ERROR
Running examples in ‘hesim-Ex.R’ failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: IndivCtstm
> ### Title: Individual-level continuous time state transition model
> ### Aliases: IndivCtstm
>
> ### ** Examples
>
> library("flexsurv")
Loading required package: survival
>
> # Treatment strategies, target population, and model structure
> strategies <- data.frame(strategy_id = c(1, 2))
> patients <- data.frame(patient_id = seq(1, 3),
+ age = c(45, 50, 60),
+ female = c(0, 0, 1))
> states <- data.frame(state_id = c(1, 2))
> hesim_dat <- hesim_data(strategies = strategies,
+ patients = patients,
+ states = states)
>
> # Parameter estimation
> ## Multi-state model
> tmat <- rbind(c(NA, 1, 2),
+ c(3, NA, 4),
+ c(NA, NA, NA))
> fits <- vector(length = max(tmat, na.rm = TRUE), mode = "list")
> surv_dat <- data.frame(mstate3_exdata$transitions)
> for (i in 1:length(fits)){
+ fits[[i]] <- flexsurvreg(Surv(years, status) ~ factor(strategy_id),
+ data = surv_dat,
+ subset = (trans == i),
+ dist = "weibull")
+ }
> fits <- flexsurvreg_list(fits)
>
> ## Utility
> utility_tbl <- stateval_tbl(data.frame(state_id = states$state_id,
+ mean = mstate3_exdata$utility$mean,
+ se = mstate3_exdata$utility$se),
+ dist = "beta")
> ## Costs
> drugcost_tbl <- stateval_tbl(data.frame(strategy_id = strategies$strategy_id,
+ est = mstate3_exdata$costs$drugs$costs),
+ dist = "fixed")
> medcost_tbl <- stateval_tbl(data.frame(state_id = states$state_id,
+ mean = mstate3_exdata$costs$medical$mean,
+ se = mstate3_exdata$costs$medical$se),
+ dist = "gamma")
>
> # Economic model
> n_samples = 2
>
> ## Construct model
> ### Transitions
> transmod_data <- expand(hesim_dat)
> transmod <- create_IndivCtstmTrans(fits, input_data = transmod_data,
+ trans_mat = tmat,
+ n = n_samples)
>
> ### Utility
> utilitymod <- create_StateVals(utility_tbl, n = n_samples, hesim_data = hesim_dat)
>
> ### Costs
> drugcostmod <- create_StateVals(drugcost_tbl, n = n_samples, hesim_data = hesim_dat)
> medcostmod <- create_StateVals(medcost_tbl, n = n_samples, hesim_data = hesim_dat)
> costmods <- list(drugs = drugcostmod,
+ medical = medcostmod)
>
> ### Combine
> ictstm <- IndivCtstm$new(trans_model = transmod,
+ utility_model = utilitymod,
+ cost_models = costmods)
>
>
> ## Simulate outcomes
> head(ictstm$sim_disease()$disprog_)
sample strategy_id patient_id grp_id from to final time_start time_stop
<num> <int> <int> <int> <num> <num> <int> <num> <num>
1: 1 1 1 1 1 2 0 0.00000000 0.42756667
2: 1 1 1 1 2 1 0 0.42756667 2.03467700
3: 1 1 1 1 1 2 0 2.03467700 2.27235975
4: 1 1 1 1 2 3 1 2.27235975 2.85620102
5: 1 1 2 1 1 2 0 0.00000000 0.05681537
6: 1 1 2 1 2 1 0 0.05681537 0.55861667
> head(ictstm$sim_stateprobs(t = c(0, 5, 10))$stateprobs_[t == 5])
Error in `[.data.table`(disprog, , `:=`(strategy_index, .GRP), by = "strategy_id") :
attempt access index 9/9 in VECTOR_ELT
Calls: head ... <Anonymous> -> indiv_ctstm_sim_stateprobs -> [ -> [.data.table
Execution halted
- checking for unstated dependencies in ‘tests’ ... OK
- checking tests ... [50s/50s] ERROR
Running ‘testthat.R’ [49s/49s]
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
- checking for unstated dependencies in vignettes ... OK
- checking package vignettes ... OK
- checking re-building of vignette outputs ... [185s/207s] ERROR
Error(s) in re-building vignettes:
...
--- re-building ‘cea.Rmd’ using rmarkdown
[WARNING] Deprecated: --highlight-style. Use --syntax-highlighting instead.
--- finished re-building ‘cea.Rmd’
--- re-building ‘intro.Rmd’ using rmarkdown
Quitting from intro.Rmd:301-304 [unnamed-chunk-19]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<error/rlang_error>
Error in `[.data.table`:
! attempt access index 9/9 in VECTOR_ELT
---
Backtrace:
▆
1. └─ictstm$sim_stateprobs(t = c(0:10))
2. └─hesim:::indiv_ctstm_sim_stateprobs(...)
3. ├─disprog[, `:=`(strategy_index, .GRP), by = "strategy_id"]
4. └─data.table:::`[.data.table`(...)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: processing vignette 'intro.Rmd' failed with diagnostics:
attempt access index 9/9 in VECTOR_ELT
--- failed re-building ‘intro.Rmd’
--- re-building ‘markov-cohort.Rmd’ using rmarkdown
[WARNING] Deprecated: --highlight-style. Use --syntax-highlighting instead.
--- finished re-building ‘markov-cohort.Rmd’
--- re-building ‘markov-inhomogeneous-cohort.Rmd’ using rmarkdown
[WARNING] Deprecated: --highlight-style. Use --syntax-highlighting instead.
--- finished re-building ‘markov-inhomogeneous-cohort.Rmd’
--- re-building ‘markov-inhomogeneous-indiv.Rmd’ using rmarkdown
Quitting from markov-inhomogeneous-indiv.Rmd:438-440 [unnamed-chunk-30]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<error/rlang_error>
Error in `[.data.table`:
! attempt access index 9/9 in VECTOR_ELT
---
Backtrace:
▆
1. └─econmod$sim_stateprobs(t = 0:60)
2. └─hesim:::indiv_ctstm_sim_stateprobs(...)
3. ├─disprog[, `:=`(strategy_index, .GRP), by = "strategy_id"]
4. └─data.table:::`[.data.table`(...)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: processing vignette 'markov-inhomogeneous-indiv.Rmd' failed with diagnostics:
attempt access index 9/9 in VECTOR_ELT
--- failed re-building ‘markov-inhomogeneous-indiv.Rmd’
--- re-building ‘mlogit.Rmd’ using rmarkdown
[WARNING] Deprecated: --highlight-style. Use --syntax-highlighting instead.
--- finished re-building ‘mlogit.Rmd’
--- re-building ‘mstate.Rmd’ using rmarkdown
Quitting from mstate.Rmd:247-249 [unnamed-chunk-17]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<error/rlang_error>
Error in `[.data.table`:
! attempt access index 9/9 in VECTOR_ELT
---
Backtrace:
▆
1. └─econmod_cr$sim_stateprobs(t = seq(0, 20, 1/12))
2. └─hesim:::indiv_ctstm_sim_stateprobs(...)
3. ├─disprog[, `:=`(strategy_index, .GRP), by = "strategy_id"]
4. └─data.table:::`[.data.table`(...)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: processing vignette 'mstate.Rmd' failed with diagnostics:
attempt access index 9/9 in VECTOR_ELT
--- failed re-building ‘mstate.Rmd’
--- re-building ‘psm.Rmd’ using rmarkdown
[WARNING] Deprecated: --highlight-style. Use --syntax-highlighting instead.
--- finished re-building ‘psm.Rmd’
SUMMARY: processing the following files failed:
‘intro.Rmd’ ‘markov-inhomogeneous-indiv.Rmd’ ‘mstate.Rmd’
Error: Vignette re-building failed.
Execution halted
- checking PDF version of manual ... [11s/14s] OK
- checking HTML version of manual ... [13s/19s] OK
- checking for non-standard things in the check directory ... OK
- DONE
Status: 3 ERRORs, 1 WARNING