View source: R/mplot3_survfit.R
mplot3_survfit | R Documentation |
mplot3
: Plot survfit
objectsPlots survival step functions using mplot3_xy
mplot3_survfit(
x,
lty = 1,
lwd = 1.5,
alpha = 1,
col = NULL,
plot.median = FALSE,
group.median = FALSE,
median.lty = 3,
median.lwd = 2,
median.col = theme$fg,
median.alpha = 0.5,
censor.mark = TRUE,
censor.col = NULL,
censor.alpha = 0.4,
censor.pch = "I",
censor.cex = 0.8,
mark.censored = FALSE,
nrisk.table = FALSE,
nrisk.pos = "below",
nrisk.spacing = 0.9,
table.font = 1,
time.at = NULL,
time.by = NULL,
xlim = NULL,
ylim = NULL,
xlab = "Time",
ylab = "Survival",
main = "",
theme = rtTheme,
palette = rtPalette,
plot.error = FALSE,
error.alpha = 0.33,
autonames = TRUE,
group.legend = NULL,
group.legend.type = c("legend", "mtext"),
group.names = NULL,
group.title = NULL,
group.line = NULL,
group.side = NULL,
legend.x = NULL,
mar = c(2.5, 3, 2, 1),
oma = NULL,
par.reset = TRUE,
pdf.width = 6,
pdf.height = 6,
filename = NULL,
...
)
x |
survfit object (output of |
lty |
Integer: Line type. See |
lwd |
Float: Line width. |
alpha |
Float: Alpha for lines. |
col |
Color, vector: Color(s) to use for survival curves and annotations. If NULL,
taken from |
plot.median |
Logical: If TRUE, draw lines at 50 percent median survival. |
group.median |
Logical: If TRUE, include median survival times with group legend |
median.lty |
Integer: Median survival line type |
median.lwd |
Float: Median line width. |
median.col |
Color for median survival lines |
median.alpha |
Float, (0, 1): Transparency for median survival lines. |
censor.mark |
Logical: If TRUE, mark each censored case. |
censor.col |
Color to mark censored cases if |
censor.alpha |
Transparency for |
censor.pch |
Character: Point character for censored marks. |
censor.cex |
Float: Character expansion factor for censor marks. |
mark.censored |
Logical: This is an alternative to |
nrisk.table |
Logical: If TRUE, print Number at risk table. |
nrisk.pos |
Character: "above" or "below": where to place |
nrisk.spacing |
Float: Determines spacing between |
table.font |
Integer: 1: regular font, 2: bold. |
time.at |
Float, vector: x-axis positions to place tickmarks and labels as well as n at risk
values if |
time.by |
Float: Divide time by this amount to determine placing of tickmarks |
xlim |
Float, vector, length 2: x-axis limits |
ylim |
Float, vector, length 2: y-axis limits |
xlab |
Character: x-axis label |
ylab |
Character: y-axis label |
main |
Character: main title |
theme |
Character: Run |
palette |
Vector of colors, or Character defining a builtin palette - get options with
|
autonames |
Logical: If TRUE, extract grouping variable names and level labels from |
group.legend |
Logical: If TRUE, include group legend |
group.names |
Character, vector: Group names to use. If NULL, extracted from |
group.title |
Character: Group legend title |
group.line |
Float, vector: Lines to print group legend using |
group.side |
Integer: Side to print group legend. Default is determined by survival curves, to avoid overlap of legend with curves. |
mar |
Float, vector, length 4: Margins. See |
oma |
Float, vector, length 4: Outer margins. See |
par.reset |
Logical: If TRUE, reset par to initial values before exit |
... |
Additional arguments to pass to theme |
E.D. Gennatas
## Not run:
# Get the lung dataset
data(cancer, package = "survival")
sf1 <- survival::survfit(survival::Surv(time, status) ~ 1, data = lung)
mplot3_survfit(sf1)
sf2 <- survival::survfit(survival::Surv(time, status) ~ sex, data = lung)
mplot3_survfit(sf2)
# with N at risk table
mplot3_survfit(sf2, nrisk.table = TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.