add_CI: Add pointwise Confidence Interval to a an object created by...

Description Usage Arguments Value Author(s) Examples

View source: R/add_CI.R

Description

S3 method for adding a pointwise confidence interval to a object created with visR. No default method is available at the moment.

Usage

1
2
3
4
add_CI(gg, ...)

## S3 method for class 'ggsurvfit'
add_CI(gg, alpha = 0.1, style = "ribbon", linetype = 2, ...)

Arguments

gg

A ggplot created with visR

...

other arguments passed on to the method to modify geom_ribbon

alpha

aesthetic of ggplot2 geom_ribbon. Default is 0.1.

style

aesthetic of ggplot2 geom_ribbon. Default is "ribbon".

linetype

aesthetic of ggplot2 geom_ribbon. Default is 2.

Value

Pointwise confidence interval overlayed on a visR ggplot

Author(s)

Steven Haesendonckx

Examples

1
2
3
4
5
6
7
8
9
library(survival)
library(dplyr)
library(tidyr)
library(ggplot2)

survfit_object <- survival::survfit(data = adtte, Surv(AVAL, 1-CNSR) ~ TRTP)
vr_plot(survfit_object) %>%
  add_CI(alpha = 0.1, style = "step", linetype = 3)
 

visR-sandbox/visR-survival documentation built on Sept. 18, 2020, 6:21 p.m.