head.msdata: Return ordinary data rows from an msdata object

View source: R/prepare_data.R

head.msdataR Documentation

Return ordinary data rows from an msdata object

Description

Return ordinary data rows from an msdata object

Usage

## S3 method for class 'msdata'
head(x, n = 6L, ...)

Arguments

x

An msdata object.

n

Number of rows to return.

...

Ignored.

Value

An ordinary data.frame containing the first n rows.

Limitations

Class-specific metadata are intentionally removed from the returned preview, so it should not be passed to rfmstate(). The source msdata object is unchanged.

Examples

ms <- define_multistate(c("A", "B"), "B", list(A = "B"))
dat <- data.frame(id = 1:3, x = 1:3, time_B = 1:3,
                  censor = NA_real_)
long <- prepare_data(dat, "id", ms, list(B = "time_B"), "censor", "x")
head(long, 2)


RFmstate documentation built on Sept. 10, 2026, 1:09 a.m.