Description Usage Arguments Details Value Examples
View source: R/variableencoding.R
This function uses an existing dataset in the shape of a tibble and then lags each variable(column) in the tibble from 1 all the way up to nlag.
1 | lagvariables(x, nlag = 5)
|
x |
the data tibble to operate on |
nlag |
the max number of lags to create for each variable |
This function requires that the first column in your tibble is called "date" and represents some kind of time epoch. Note also that you will get no NA's returned. This means that the returned data will start nlag-1 days later than the input data.
a new tibble with the data lagged
1 2 3 4 5 6 7 8 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.