create_lags | R Documentation |
Creates a lag matrix of order p. Can include or exclude original series, and trim the NAs in the start of the sample.
create_lags(y, p = 1, include.original = TRUE, trim = TRUE)
y |
vector or matrix to lag |
p |
lag length |
include.original |
logical, if TRUE the original series are left inside the output matrix. |
trim |
logical, if TRUE the initial NAs due to the lag gets trimmed |
the lagged vector or matrix
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.