Learn R Programming

qwraps2 (version 0.2.3)

qkmplot: Kaplan-Meier Plot

Description

A ggplot2 version of a Kaplan-Meier Plot

Usage

qkmplot(x, conf_int = FALSE, ...)
qkmplot_bulid_data_frame(x)

Arguments

x
object
conf_int
logical if TRUE show the CI
...
Other arguments passed to survival::plot.survfit

Value

a ggplot.

Details

Functions to build, explicitly or implicitly, data.frames and then creating a ggplot2 KM plot.

Examples

Run this code
require(survival)
leukemia.surv <- survival::survfit(survival::Surv(time, status) ~ x, data = survival::aml) 
survival:::plot.survfit(leukemia.surv, conf.int = TRUE, lty = 2:3, col = 1:2)

qkmplot(leukemia.surv, conf_int = TRUE) 

Run the code above in your browser using DataLab