lag_vector: Lag an arbitrary vector

Description Usage Arguments Examples

View source: R/lag_vector.R

Description

Lag an arbitrary vector

Usage

1
lag_vector(x, k, type = c("cycle", "na.fill", "trim"), ...)

Arguments

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

Examples

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

AkselA/R-ymse documentation built on March 21, 2020, 9:52 a.m.