Skip to contents

grid::grid.draw() methods for objects of classes 'ggsurvfit' and 'ggcuminc'. These are implemented to allow users to directly call ggplot2::ggsave() on 'ggsurvfit' figures.

Usage

# S3 method for ggsurvfit
grid.draw(x, recording = TRUE)

# S3 method for ggcuminc
grid.draw(x, recording = TRUE)

Arguments

x

an object of class 'ggsurvfit' or 'ggcuminc'

recording

A logical value to indicate whether the drawing operation should be recorded on the Grid display list.

Value

None

Examples

survfit2(Surv(time, status) ~ surg, data = df_colon) %>%
  ggsurvfit() %>%
  grid.draw()


library(tidycmprsk)
cuminc(Surv(ttdeath, death_cr) ~ trt, trial) %>%
  ggcuminc() %>%
  grid.draw()
#> Plotting outcome "death from cancer".