grid.draw_ggsurvfit: Draw ggsurvfit object

grid.draw_ggsurvfitR Documentation

Draw ggsurvfit object

Description

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 class 'ggsurvfit'
grid.draw(x, recording = TRUE)

## S3 method for class '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()

ggsurvfit documentation built on Nov. 2, 2023, 5:33 p.m.