| survexport | R Documentation |
Passes all non-empty tables from tabsurv() to the existing tabexport()
function. It is also called internally when tabsurv(export=, file=) is
used, so a complete Word/Excel/HTML report can be requested in one command.
survexport(
x,
export = NULL,
file = NULL,
open = FALSE,
title = NULL,
sheet = NULL,
overwrite = TRUE,
quiet = FALSE
)
x |
An object returned by |
export, file, open, title, sheet, overwrite, quiet |
Passed to |
The result returned by tabexport().
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)
# Export when a file is wanted, for example:
# survexport(s, export = "xlsx", file = tempfile(fileext = ".xlsx"))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.