draw_KM: draw_KM

View source: R/1_plots.R

draw_KMR Documentation

draw_KM

Description

draw KM-plot with two or more group

Usage

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"),
  ...
)

Arguments

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

Value

a KM-plot

Author(s)

Xiaojie Sun

Examples

require("survival")
x = survival::lung
draw_KM(meta = x,
       group_list = x$sex,event_col = "status")

tinyarray documentation built on Aug. 18, 2023, 9:07 a.m.