axe-survreg.penal | R Documentation |
survreg.penal objects are created from the survival package. They
are returned from the survreg
function, representing fitted
parametric survival models.
## S3 method for class 'survreg.penal'
axe_call(x, verbose = FALSE, ...)
## S3 method for class 'survreg.penal'
axe_data(x, verbose = FALSE, ...)
## S3 method for class 'survreg.penal'
axe_env(x, verbose = FALSE, ...)
x |
A model object. |
verbose |
Print information each time an axe method is executed.
Notes how much memory is released and what functions are
disabled. Default is |
... |
Any additional arguments related to axing. |
Axed survreg object.
# Load libraries
library(parsnip)
library(survival)
# Create model and fit
survreg_fit <- surv_reg(mode = "regression", dist = "weibull") %>%
set_engine("survival") %>%
fit(Surv(time, status) ~ rx, data = rats)
out <- butcher(survreg_fit, verbose = TRUE)
# Another survreg.penal object
wrapped_survreg.penal <- function() {
some_junk_in_environment <- runif(1e6)
fit <- survreg(Surv(time, status) ~ rx,
data = rats, subset = (sex == "f"))
return(fit)
}
# Remove junk
cleaned_sp <- axe_env(wrapped_survreg.penal(), verbose = TRUE)
# Check size
lobstr::obj_size(cleaned_sp)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.