plot_km {easysurv} | R Documentation |
Plot Kaplan-Meier Data
Description
Generates a Kaplan-Meier survival curve plot using
ggsurvfit::ggsurvfit()
with customizable options.
This function provides sensible defaults while allowing for customization.
Usage
plot_km(
fit,
risktable = TRUE,
risktable_symbols = TRUE,
median_line = TRUE,
legend_position = "top",
plot_theme = theme_easysurv(),
risktable_theme = theme_risktable_easysurv()
)
Arguments
fit |
A survival::survfit object representing the survival data. |
risktable |
Logical value indicating whether to include a risk table
below the plot. Default is |
risktable_symbols |
Logical value indicating whether to include symbols
instead of text to label risk table strata. Default is |
median_line |
Logical value indicating whether to include a line
representing the median survival time. Default is |
legend_position |
Position of the legend in the plot. Default is "top". |
plot_theme |
ggplot2 theme for the plot. Default is
|
risktable_theme |
ggplot2 theme for the risk table. Default is
|
Value
A ggplot object representing the Kaplan-Meier survival curve plot.
Examples
library(ggsurvfit)
fit <- survfit2(Surv(time, status) ~ surg, data = df_colon)
plot_km(fit, risktable_symbols = FALSE)