Lag | R Documentation |
Create a matrix of lagged variables
Lag(v, k, group = NULL)
v |
a numeric vector |
k |
an integer vector giving lag numbers |
group |
a factor or a list of factors defining groups of observations |
## Ten day "time series" x <- rnorm(10) ## Lag 1 of `x' Lag(x, 1) ## Lag 0, 1, and 2 of `x' Lag(x, 0:2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.