Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

dlag

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

Analysis of Multivariate Event Times

v1.2.8.1
GPL (>= 2)
Authors
Klaus K. Holst [aut, cre], Thomas Scheike [aut]
Initial release
2020-09-25

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.