powered by
Create a matrix of lagged variables
Lag(v, k, group = NULL)
a numeric vector
an integer vector giving lag numbers
a factor or a list of factors defining groups of observations
# NOT RUN { ## 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) # }
Run the code above in your browser using DataLab