lags: Multiple lags of time series

Description Usage Arguments Value Examples

View source: R/ts.R

Description

Multiple lags of time series

Usage

1
lags(x, k, ...)

Arguments

x

A vector or univariate time series.

k

A numeric value or a vector denoting which lags should be retrieved.

...

Further parameters passed to lag.

Value

Matrix where the number of rows is identical to the length of x. The number of columns is identical the number of entries in k.

Examples

1
2
3
4
5
x <- 1:10
lags(x, c(1, 2, 3))

z <- ts(1:10)
lags(z, c(1, 2, 5))

sfeuerriegel/ResearchGroupTools documentation built on May 29, 2019, 8:01 p.m.