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

merge.Lexis

Merge a Lexis object with a data frame


Description

Merge additional variables from a data frame into a Lexis object.

Usage

## S3 method for class 'Lexis'
merge(x, y, id, by, ...)

Arguments

x

an object of class Lexis

y

a data frame

id

the name of the variable in y to use for matching against the variable lex.id in x.

by

if matching is not done by id, a vector of variable names common to both x and y

...

optional arguments to be passed to merge.data.frame

Details

A Lexis object can be considered as an augmented data frame in which some variables are time-dependent variables representing follow-up. The Lexis function produces a minimal object containing only these time-dependent variables. Additional variables may be added to a Lexis object using the merge method.

Value

A Lexis object with additional columns taken from the merged data frame.

Note

The variable given as the by.y argument must not contain any duplicate values in the data frame y.

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.