Learn R Programming

climatehealth (version 1.0.0)

get_lags_and_means: Create lagged columns and provide the mean value.

Description

Creates new columns containing lagged values over n rows and determine the mean of the lagged column.

Usage

get_lags_and_means(data, lagcol, nlags)

Value

Dataframe with added columns for lagged values and mean(s) of those lags.

Arguments

data

Dataframe containing a daily time series of climate and health data

lagcol

Character. The column to lag.

nlags

Character. How many rows to obtain a lag from.