Visualizes survival differences between clusters.
Usage
plot_survival(
time,
event,
clusters,
title = "Kaplan-Meier Survival Curves",
colors = NULL,
conf_int = TRUE,
risk_table = FALSE
)
Arguments
- time
Survival time vector.
- event
Event indicator (1 = event, 0 = censored).
- clusters
Vector of cluster assignments.
- title
Plot title.
- colors
Cluster colors.
- conf_int
Show confidence intervals (default: TRUE).
- risk_table
Show risk table (default: FALSE).
Value
A ggplot object (if survminer available) or base R plot.