plot_KMCurve: Plot Kaplan-Meier Curve

Description Usage Arguments Value Examples

Description

This function plots Kaplan-Meier Curve for survival analysis.

Usage

1
2
3
4
5
plot_KMCurve(clinical, labels, limit = NULL, annot = NULL,
  color = NULL, font = "Arial", xlab = "Follow up",
  ylab = "Survival Probability", title = NULL, legend.pos = "top",
  palette = "jama_classic", risk.table = T, risk.table.ratio = 0.4,
  anno.pos = "bottom", anno.x.shift = 0.5)

Arguments

clinical

a survival object created by Surv function in survival package

labels

a vector containing subtyping labels of patients

limit

a numeric indicating the time limit of this KM plot

annot

a character indicating the annotation showed up in the plot

color

a vector containing colors used for different subtypes

font

a character indicating the font used in the plot (default: "Arial")

xlab

a character indicating the label of x-axis (default: "Follow up")

ylab

a character indicating the label of y-axis (default: "Survival Probability")

title

a character indicating the title (default: NULL)

palette

color paletter (default: "jama_classic")

risk.table

a logical indicating whether show risk table or not (default: TRUE)

risk.table.ratio

a numeric indicating the relative size of risk table (default: 0.4)

anno.pos

position of annotation (default: "bottom")

anno.x.shift

relative position of annotation in x-axis (default: 0.5)

lenged.pos

a character indicating whether the legend is (default: "top")

Value

a ggplot2 object of the plot

Examples

1
2
3
4
5
6
7
 library(survival)
 library(survminer)
 extrafont::loadfonts()
 data(myeloma)
 clin <- Surv(myeloma$time, myeloma$event)
 labs <- factor(myeloma$molecular_group)
 plot_KMCurve(clin, labs)

gflab/gfplot documentation built on Sept. 14, 2020, 12:03 a.m.