Description Usage Arguments Value Examples
Make a survival curve figure as a ggplot2 object
1 |
formula |
A formula object, which must have a 'Surv' object as the response on the left of the '~' operator and the grouping term (often the treatment) on the right. |
data |
A data frame in which to interpret the variables named in the formula |
timepts |
A numeric vector of time points to show on the x-axis |
colors |
Custom colors for each group line |
ribbon |
Logical to show a semi-transparent confidence band ribbon |
A ggplot2 object of a Kaplan-Meier curve
1 2 3 4 5 6 7 8 | makeKMFig(formula = survival::Surv(stime, scens) ~ treatment, data = mice)
makeKMFig(formula = survival::Surv(stime, scens) ~ treatment, data = mice) +
ggplot2::labs(y = "OS", color = "Treatment")
makeKMFig(formula = survival::Surv(stime, scens) ~ treatment, data = mice, ribbon = FALSE) +
ggplot2::scale_color_brewer(palette = "Set1") +
ggplot2::scale_fill_brewer(palette = "Set1")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.