lag {ts} | R Documentation |
Computed a lagged version of a time series, shifting the time base
back by k
observations.
lag(x, ...) lag.default(x, k=1)
x |
A vector or matrix or univariate or multivariate time series |
k |
The number of lags (in units of observations). |
... |
Arguments for future methods. |
Vector or matrix arguments x
are coerced to time series.
A time series object.
Note the sign of k
: a series lagged by a positive k
starts earlier.
B.D. Ripley
data(UKLungDeaths) lag(ldeaths, 12) # starts one year earlier