Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

subset.Lexis

Subsetting Lexis (and stacked.Lexis) objects


Description

Return subsets of Lexis objects which meet conditions

Usage

## S3 method for class 'Lexis'
subset(x, ...)
## S3 method for class 'Lexis'
x[...]
## S3 method for class 'stacked.Lexis'
subset(x, ...)

Arguments

x

an object of class Lexis

...

additional arguments to be passed to subset.data.frame. This will normally be some logical expression selecting a subset of the rows. For details see subset.data.frame.

Details

The subset method for Lexis objects works exactly as the method for data frames. So does the "[" method. The special methods are needed in order to propagate the Lexis-specific attributes.

The method for stacked.Lexis objects also shrinks the set of levels for lex.Cst and lex.Xst to those actually occurring in the resulting data frame.

Value

A Lexis object with selected rows and columns.

Author(s)

Martyn Plummer

See Also


Epi

Statistical Analysis in Epidemiology

v2.44
GPL-2
Authors
Bendix Carstensen [aut, cre], Martyn Plummer [aut], Esa Laara [ctb], Michael Hills [ctb]
Initial release
2021-02-28

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.