% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dutils.R
\name{dlag}
\alias{dlag}
\alias{dlag<-}
\title{Lag operator}
\usage{
dlag(data, x, k = 1, combine = TRUE, simplify = TRUE, names, ...)
}
\arguments{
\item{data}{data.frame or vector}

\item{x}{optional column names or formula}

\item{k}{lag (vector of integers)}

\item{combine}{combine results with original data.frame}

\item{simplify}{Return vector if possible}

\item{names}{optional new column names}

\item{...}{additional arguments to lower level functions}
}
\description{
Lag operator
}
\examples{
d <- data.frame(y=1:10,x=c(10:1))
dlag(d,k=1:2)
dlag(d,~x,k=0:1)
dlag(d$x,k=1)
dlag(d$x,k=-1:2, names=letters[1:4])
}
