powered by
draw KM-plot with two or more group
draw_KM( meta, group_list, time_col = "time", event_col = "event", legend.title = "Group", legend.labs = levels(group_list), color = c("#2874C5", "#f87669", "#e6b707", "#868686", "#92C5DE", "#F4A582", "#66C2A5", "#FC8D62", "#8DA0CB", "#E78AC3", "#A6D854", "#FFD92F", "#E5C494", "#B3B3B3"), ... )
a KM-plot
survival data with time and event column
A factor with duplicated character or factor
colname of time
colname of event
legend title
character vector specifying legend labels
color vector
other parameters from ggsurvplot
Xiaojie Sun
require("survival") x = survival::lung draw_KM(meta = x, group_list = x$sex,event_col = "status")
Run the code above in your browser using DataLab