tidy_survfit {ggsurvfit} | R Documentation |
Tidy a survfit object
Description
The broom package exports a tidier for "survfit"
objects.
This function adds on top of that and returns more information.
The function also utilizes additional information stored when the
survfit object is created with survfit2()
.
It's recommended to always use this function with survfit2()
.
Usage
tidy_survfit(
x,
times = NULL,
type = c("survival", "risk", "cumhaz", "cloglog")
)
Arguments
x |
a 'survfit' object created with | |||||||||||
times |
numeric vector of times. Default is | |||||||||||
type |
type of statistic to report.
Available for Kaplan-Meier estimates only.
Default is
|
Value
a tibble
Examples
survfit2(Surv(time, status) ~ factor(ph.ecog), data = df_lung) %>%
tidy_survfit()
[Package ggsurvfit version 1.1.0 Index]