\Header{lag}{Lag a Time Series}
\methalias{lag.default}{lag}
\keyword{ts}{lag}
\begin{Description}\relax
Computed a lagged version of a time series, shifting the time base
back by \code{k} observations.\end{Description}
\begin{Usage}
\begin{verbatim}
lag(x, ...)
lag.default(x, k=1)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] A vector or matrix or univariate or multivariate time series
\item[\code{k}] The number of lags (in units of observations).
\item[\code{...}] Arguments for future methods.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
Vector or matrix arguments \code{x} are coerced to time series.\end{Details}
\begin{Value}
A time series object.\end{Value}
\begin{Note}\relax
Note the sign of \code{k}: a series lagged by a positive \code{k}
starts \emph{earlier}.\end{Note}
\begin{Author}\relax
B.D. Ripley\end{Author}
\begin{SeeAlso}\relax
\code{\Link{diff}}, \code{\Link{deltat}}\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data(UKLungDeaths)
lag(ldeaths, 12) # starts one year earlier
\end{ExampleCode}
\end{Examples}

