Compute a lagged version of a time series, shifting the time base back by a given number of observations.
lag(x, ...) ## S3 method for class 'default': lag((x, k = 1, ...))
- A vector or matrix or univariate or multivariate time series
- The number of lags (in units of observations).
- further arguments to be passed to or from methods.
Vector or matrix arguments
x are coerced to time series.
lag is a generic function; this page documents its default method.
A time series object.
Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) The New S Language. Wadsworth & Brooks/Cole.
Note the sign of
k: a series lagged by a positive
k starts earlier.
Documentation reproduced from R 3.0.2. License: GPL-2.