nrisk: Add an axis describing number at risk to a KM curve

View source: R/nrisk.r

nriskR Documentation

Add an axis describing number at risk to a KM curve

Description

Add an axis describing number at risk to a KM curve

Usage

nrisk(fit, cex = 0.8)

Arguments

fit

A survfit or survfitms object

cex

Character expansion parameter for axis labels, as in par()

Examples

library(survival)

fit <- survfit(Surv(time, status) ~ 1, veteran)
Plot(fit)
nrisk(fit)

fit <- survfit(Surv(time, status) ~ celltype, veteran)
op <- par(mar=c(5,5,6,7))
Plot(fit, legend='right')
nrisk(fit)
par(op)


pbreheny/breheny documentation built on Feb. 18, 2025, 5:07 a.m.