powered by
lagmat(x, lags)
[NROW(x),length(lags)]
x = rnorm(100) lx <- lagmat(x,2) tail(lx) tail(x)
Run the code above in your browser using DataLab