draw_KM | R Documentation |
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"),
...
)
meta |
survival data with time and event column |
group_list |
A factor with duplicated character or factor |
time_col |
colname of time |
event_col |
colname of event |
legend.title |
legend title |
legend.labs |
character vector specifying legend labels |
color |
color vector |
... |
other parameters from ggsurvplot |
a KM-plot
Xiaojie Sun
require("survival")
x = survival::lung
draw_KM(meta = x,
group_list = x$sex,event_col = "status")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.