| surv_tables | R Documentation |
Converts every non-empty report component of a tabsurv() result to a named
list of data frames, including descriptive, life-table, and optional
interpretation tables. For a
hierarchical result, tables are retained separately for every outer stratum.
This keeps survival export compatible with the existing tabexport()
data-frame workflow without changing tabexport() itself. Examples are self-contained.
surv_tables(x)
x |
An object returned by |
A named list of data frames.
if (requireNamespace("survival", quietly = TRUE)) {
d <- data.frame(time = c(5, 8, 10, 12, 15, 18),
event = c(1, 0, 1, 1, 0, 1),
group = factor(rep(c("A", "B"), 3)))
s <- tabsurv(time, event, by = group, data = d, show = FALSE)
z <- surv_tables(s)
names(z)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.