if (FALSE) { # rlang::is_installed("flexsurv")
# Load libraries
library(parsnip)
library(flexsurv)
# Create model and fit
flexsurvreg_fit <- surv_reg(mode = "regression", dist = "gengamma") %>%
set_engine("flexsurv") %>%
fit(Surv(Tstart, Tstop, status) ~ trans, data = bosms3)
out <- butcher(flexsurvreg_fit, verbose = TRUE)
# Another flexsurvreg model object
wrapped_flexsurvreg <- function() {
some_junk_in_environment <- runif(1e6)
fit <- flexsurvreg(Surv(futime, fustat) ~ 1,
data = ovarian, dist = "weibull")
return(fit)
}
out <- butcher(wrapped_flexsurvreg(), verbose = TRUE)
}
Run the code above in your browser using DataLab