surv_plot: Plot survival curves with number-at-risk table

Description Usage Arguments Value See Also Examples

View source: R/surv_plot.R

Description

Produce a survival curve plot and number-at-risk table using survminer::ggsurvplot and finalfit conventions.

Usage

1
surv_plot(.data, dependent, explanatory, ...)

Arguments

.data

Dataframe.

dependent

Character vector of length 1: Survival object of the form Surv(time, status).

explanatory

Character vector of max length 2: quoted name(s) of explanatory variables.

...

Arguments passed to ggsurvplot.

Value

Returns a table and plot produced in ggplot2.

See Also

Other finalfit plot functions: coefficient_plot(), ff_plot(), hr_plot(), or_plot()

Examples

1
2
3
4
5
6
7
8
9
library(finalfit)
library(dplyr)

# Survival plot
data(colon_s)
explanatory = c("perfor.factor")
dependent = "Surv(time, status)"
colon_s %>%
  surv_plot(dependent, explanatory, xlab="Time (days)", pval=TRUE, legend="none")

finalfit documentation built on June 11, 2021, 5:17 p.m.