draw_survival_curve: draw survival curve

Description Usage Arguments Value Author(s) Examples

View source: R/utils.R

Description

Draw a survival curve based on survminer package. This is a wrapper function of ggsurvplot.

Usage

1
2
3
4
5
6
7
8
draw_survival_curve(
  exp,
  living_days,
  living_events,
  write_name,
  title_name = "",
  threshold = NA
)

Arguments

exp

expression level for gene.

living_days

The survival time (days) for each individual.

living_events

The survival event for each individual, 0 indicates alive and 1 indicates death. Other choices are TRUE/FALSE (TRUE = death) or 1/2 (2=death). For interval censored data, the status indicator is 0=right censored, 1=event at time, 2=left censored, 3=interval censored.

write_name

The name for pdf file which contains the result figure.

title_name

The title for the result figure.

threshold

Threshold used to indicate the high risk or low risk.

Value

This function will generate a pdf file with 300dpi which compare survival curves using the Kaplan-Meier (KM) test.

Author(s)

Xin Yu

Examples

1
2
3
4
5
6
7
data(demo_survival_data)
library(survival)
demo_set<-create_demo()
draw_survival_curve(demo_set[1,],
    living_days = demo_survival_data[,1],
    living_events =demo_survival_data[,2],
    write_name = "demo_data" )

EnMCB documentation built on Dec. 22, 2020, 2 a.m.