nrisk: Get number-at-risk from a survfit object

View source: R/survplot.R

nriskR Documentation

Get number-at-risk from a survfit object

Description

Retrieve the number-at-risk from a survfit object for the specified times, for each strata.

Usage

nrisk(x, times = pretty(x$time))

Arguments

x

An object of type survfit.

times

The timepoints of interest.

Details

This function was written and documented by Aron Charles Eklund in his package survplot version 0.0.7.

Value

A matrix indicating the number-at-risk for each timepoint (columns) and stratum (rows).

Author(s)

Aron Charles Eklund (survplot version 0.0.7)

See Also

survplot

Examples

  
library(survival)
data(colon)
surv <- Surv(colon$time, colon$status)

## example with stratification
nrisk(survfit(surv ~ colon$rx))

## example without stratification
nrisk(survfit(surv ~ 1))


MalgorzataOles/BloodCancerMultiOmics2017 documentation built on March 29, 2024, 2:29 p.m.