rt_ts_create_lagged_dataset | R Documentation |
returns a new dataset containing the lagged values for specified variables
rt_ts_create_lagged_dataset( dataset, num_lags = 1, lag_variables = NULL, keep_variables = NULL )
dataset |
a time-series dataset (single- or multi-variable) |
num_lags |
the number of lags to include (e.g. '3' will include 3 lagged variables for each applicable variable, 'x_lag_1', 'x_lag_2', 'x_lag_3') |
lag_variables |
the variables (i.e. columns) to include lagged values for (the original column will be retained). A value of 'NULL' is used for single-variable datasets (i.e. ts datasets that have no columns) or, for multi-variable datasets, will create lagged variables for *all* variables in the dataset. All variables that are not specified in 'lag_variables' are removed. |
keep_variables |
the variables to retain in the dataset which are not specified in 'lag_variables'. A value of 'NULL' is used for single-variable datasets. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.