autotab_risk: Create a ggplot of a risk table

Description Usage Arguments Value Examples

View source: R/autoplot.R

Description

Create a ggplot of a risk table

Usage

1
autotab_risk(x, timeby = 10)

Arguments

x

survfit object

timeby

Integer to indicate range to summarise risk table

Value

ggplot object

Examples

1
2
3
4
5
6
7
8
9
library(survival)
library(magrittr)
library(dplyr)
library(ggplot2)
library(broom)
fit <- survival::survfit(Surv(time, status) ~ sex, data = lung)
autotab_risk(fit, 50) %>%
ggplot(aes(x = time, y = strata_id, label = n.risk, group= strata)) + 
geom_text() 

bailliem/visRam documentation built on Feb. 2, 2020, 12:04 a.m.