Description Usage Arguments Examples
Lag an arbitrary vector
1 | lag_vector(x, k, type = c("cycle", "na.fill", "trim"), ...)
|
x |
vector to be lagged |
k |
integer vector specifying the number of lags |
type |
how to deal with non-overlapping sections |
... |
further arguments passed to methods |
1 2 3 4 5 | x <- 1:9
lag_vector(x, c(0, 1, -2, 3))
lag_vector(x, c(0, 1, -2, 3), "na")
lag_vector(x, c(0, 1, -2, 3), "trim")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.