Skip to contents

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)