Learn R Programming

ggRandomForests (version 1.1.2)

plot.gg_survival: Plot a gg_survival object.

Description

Plot a gg_survival object.

Usage

## S3 method for class 'gg_survival':
plot(x, type = c("surv", "cum_haz", "hazard", "density",
  "mid_int", "life", "proplife"), error = c("shade", "bars", "lines", "none"),
  ...)

Arguments

x
gg_survival or a survival gg_rfsrc object created from a randomForestSRC::rfsrc object
type
"surv", "cum_haz","hazard","density","mid_int", "life","proplife"
error
"shade", "bars", "lines" or "none"
...
not used

Value

  • ggplot object

Examples

Run this code
#' data(pbc, package="randomForestSRC")
pbc$time <- pbc$days/364.25

# This is the same as kaplan
gg_dta <- eventtable(interval="time", censor="status",
                     data=pbc)

plot(gg_dta, error="none")
plot(gg_dta)

# Stratified on treatment variable.
gg_dta <- eventtable(interval="time", censor="status",
                     data=pbc, strat="treatment")

plot(gg_dta, error="none")
plot(gg_dta)

Run the code above in your browser using DataLab