This help topic is for R version 1.1. For the current version of R, try https://stat.ethz.ch/R-manual/R-patched/library/ts/html/lag.html
lag {ts}R Documentation

Lag a Time Series

Description

Computed a lagged version of a time series, shifting the time base back by k observations.

Usage

lag(x, ...)
lag.default(x, k=1)

Arguments

x

A vector or matrix or univariate or multivariate time series

k

The number of lags (in units of observations).

...

Arguments for future methods.

Details

Vector or matrix arguments x are coerced to time series.

Value

A time series object.

Note

Note the sign of k: a series lagged by a positive k starts earlier.

Author(s)

B.D. Ripley

See Also

diff, deltat

Examples

data(UKLungDeaths)
lag(ldeaths, 12) # starts one year earlier