dlag: Lag operator

View source: R/dutils.R

dlagR Documentation

Lag operator

Description

Lag operator

Usage

dlag(data, x, k = 1, combine = TRUE, simplify = TRUE, names, ...)

Arguments

data

data.frame or vector

x

optional column names or formula

k

lag (vector of integers)

combine

combine results with original data.frame

simplify

Return vector if possible

names

optional new column names

...

additional arguments to lower level functions

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])

mets documentation built on Oct. 2, 2022, 5:06 p.m.