LagVector | R Documentation |
Compute a lagged version of a numeric vector, shifting the time base back or forward by a given number of observations.
LagVector(x, k)
x |
[1:n] vector |
k |
The number of lags (in units of observations): back shifting: positiv value, forward shifting: negative value |
for time series please use lag
Shifted vector [1:n] with k NaN values at the beginning (k positive) or the end (k negative)
Michael Thrun
lag
LagVector(1:100,5)
LagVector(1:100,-5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.