From 863ebf79bb68f3a45895d1822cd5b05d368a617b Mon Sep 17 00:00:00 2001 From: Klaus Holst Date: Tue, 9 Dec 2025 12:32:58 +0100 Subject: [PATCH 1/3] fix(outcome_phreg): time,status variables must be in the data.frame and not only in env. --- R/outcome_models.R | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/R/outcome_models.R b/R/outcome_models.R index 07a546c..04133be 100644 --- a/R/outcome_models.R +++ b/R/outcome_models.R @@ -367,12 +367,15 @@ outcome_phreg <- function(data, timemod <- proc_phreg(model) model <- timemod$model if (is.null(cens.model)) { - if (is.null(model)) stop( + if (is.null(model)) { + stop( "Need 'phreg' object (argument 'model') or specify parametric model" - ) - fcens <- with(model, Surv(time, !status) ~ 1) - cens.model <- mets::phreg(fcens, data = model.frame(model)) - cens.lp <- ~fcens + ) + } + fcens <- Surv(time, !status) ~ 1 + newd <- with(model, data.frame(time, status)) + cens.model <- mets::phreg(fcens, data = newd) + cens.lp <- fcens } censmod <- proc_phreg(cens.model) cens.model <- censmod$model From d80c8bf5a2f6e537ee60b3d30db9e3e44eb668f9 Mon Sep 17 00:00:00 2001 From: Benedikt Sommer Date: Wed, 10 Dec 2025 18:19:34 +0100 Subject: [PATCH 2/3] trigger workflows From 998b124f778aa8931d76e53cd0dcbc0ad780ec85 Mon Sep 17 00:00:00 2001 From: Benedikt Sommer Date: Wed, 10 Dec 2025 18:31:15 +0100 Subject: [PATCH 3/3] fix linter --- R/Trial.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/Trial.R b/R/Trial.R index 6d4cb07..b49fc33 100644 --- a/R/Trial.R +++ b/R/Trial.R @@ -819,7 +819,7 @@ trial_simulate <- function(self, n, .niter, ...) { } xt <- lapply(xt, data.table) if (count == 0) nsim <- n * length(xt) - for (i in seq_len(length(xt))) { + for (i in seq_along(xt)) { ## Append subject id and period variable xt[[i]][, `:=`(id = ids, num = i - 1)] }