lag: Create lag variables

Description Usage Arguments Value Author(s)

Description

This function finds non-event days that are near events (e.g. the day after a heat waves or ozone events). The days are potentially excluded as potential control days when using matching approachs.

Usage

1
lag(date, x, lags = 1, by)

Arguments

date

A vector of dates.

x

The varibale to be lagged

lags

The number of days the variable should be lagged

by

A vector of ids or a matrix with columns as the id variables. The events will be found separately within each unique combination of id variables. This is optional.

Value

Returns a data.table with lagged exposures as well as the date and by variables.

Author(s)

Ander Wilson


AnderWilson/smurf documentation built on May 5, 2019, 4:57 a.m.