Learn R Programming

reportRmd (version 0.1.0)

ggkmcif_paste: Plot KM and CIF curves with ggplot

Description

This function puts together a survival curve, and a number at risk table

Usage

ggkmcif_paste(list_gg)

Value

a gtable with three elements, the survival curve, a spacer and the number at risk table

Arguments

list_gg

list containing the results of ggkmcif

Examples

Run this code
data("pembrolizumab")
plot <- ggkmcif(response=c('pfs_time','pfs_status'),
data=pembrolizumab,returns = TRUE)

# Highlighting a section of the curve
plot[[1]] <- plot[[1]] +
ggplot2::geom_rect(xmin=4,xmax=8,ymin=0.15,ymax=0.4,alpha=0.01,fill='yellow')

# Putting the curve back together
ggkmcif_paste(plot)

Run the code above in your browser using DataLab