dlag | R Documentation |
Lag operator
dlag(data, x, k = 1, combine = TRUE, simplify = TRUE, names, ...)
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 |
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])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.