Please use tbl_survfit. Function takes a survfit object as an argument, and provides a formatted summary of the results

tbl_survival(x, ...)

# S3 method for survfit
tbl_survival(
x,
times = NULL,
probs = NULL,
label = ifelse(is.null(probs), "{time}", "{prob*100}%"),
level_label = "{level}, N = {n}",
failure = FALSE,
missing = "-",
estimate_fun = NULL,
...
)

## Arguments

x

A survfit object with a no stratification (e.g. survfit(Surv(ttdeath, death) ~ 1, trial)), or a single stratifying variable (e.g. survfit(Surv(ttdeath, death) ~ trt, trial))

...

Not used

times

Numeric vector of times for which to return survival probabilities.

probs

Numeric vector of probabilities with values in (0,1) specifying the survival quantiles to return

label

String defining the label shown for the time or prob column. Default is "{time}" or "{prob*100}%". The input uses glue::glue notation to convert the string into a label. A common label may be "{time} Months", which would resolve to "6 Months" or "12 Months" depending on specified times.

level_label

Used when survival results are stratified. It is a string defining the label shown. The input uses glue::glue notation to convert the string into a label. The default is "{level}, N = {n}". Other information available to call are '{n}', '{level}', '{n.event.tot}', '{n.event.strata}', and '{strata}'. See below for details.

String to be displayed as column header. Default is '**Time**' when time is specified, and '**Quantile**' when probs is specified.

String to be displayed as column header of the Kaplan-Meier estimate. Default is '**Probability**' when time is specified, and '**Time**' when probs is specified.

failure

Calculate failure probabilities rather than survival probabilities. Default is FALSE. Does NOT apply to survival quantile requests

missing

String indicating what to replace missing confidence limits with in output. Default is missing = "-"

estimate_fun

Function used to format the estimate and confidence limits. The default is style_percent(x, symbol = TRUE) for survival probabilities, and style_sigfig(x, digits = 3) for time estimates.