add_CNSR: Add censoring symbols to a visR ggplot through an S3 method

Description Usage Arguments Value Author(s) Examples

View source: R/add_CNSR.R

Description

S3 method for adding censoring symbols to visR ggplot. No default method is available at the moment.

Usage

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

## S3 method for class 'ggsurvfit'
add_CNSR(gg, shape = 3, size = 2, ...)

Arguments

gg

A ggplot created with visR

...

other arguments passed on to the method to modify geom_point

shape

aesthetic of ggplot2 geom_point. Default is 3.

size

aesthetic of ggplot2 geom_point. Default is 2.

Value

Censoring symbols 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.