Learn R Programming

ggfortify (version 0.4.17)

fortify.survfit: Convert survival::survfit to data.frame

Description

Convert survival::survfit to data.frame

Usage

# S3 method for survfit
fortify(model, data = NULL, surv.connect = FALSE, fun = NULL, ...)

Value

data.frame

Arguments

model

survival::survfit instance

data

original dataset, if needed

surv.connect

logical frag indicates whether connects survival curve to the origin

fun

an arbitrary function defining a transformation of the survival curve

...

other arguments passed to methods

Examples

Run this code
if (FALSE) {
if (requireNamespace("survival", quietly = TRUE)) {
  fortify(survfit(Surv(time, status) ~ sex, data = lung))
  fortify(survfit(Surv(time, status) ~ 1, data = lung))
  fortify(survfit(coxph(Surv(time, status) ~ sex, data = lung)))
  fortify(survfit(coxph(Surv(time, status) ~ 1, data = lung)))
}
}

Run the code above in your browser using DataLab