View source: R/shared_pipeline_utils.R
append_lags | R Documentation |
Append n lags of a group of variables to a dataset
append_lags(data, n_lags, lag_vars, default = 0)
data |
data frame |
n_lags |
int. number of lags to append |
lag_vars |
character vector. Names of dataframe columns for which you want lags |
default |
vector of length 1 or nrow(data), as in the |
The original data frame with additional columns x_lag1
,x_lag2
,...,x_lag{n_lags}
for x
in lag_vars
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.