lags: Build a lagged data set or series

View source: R/deepTimeSeries.r

lagsR Documentation

Build a lagged data set or series

Description

lags builds a lagged data series or entire data set.

Usage

lags(x, k = 1, between = FALSE, na = NA)

Arguments

x

A vector for building a lagged data series or an entire data set.

k

The number of lags. A lag denotes a delay in time or a period shift. A lagged variable, also known as delayed variable, holds the values of past or future periodic values of the variable itself, depending on the direction of the shift. The sign of k specifies the direction of the shift. A positive lag shifts sequence values forward in time, so into the future. A negative lag shifts sequence values back in time, so into the past.

between

Controls whether only the desired lag is considered (FALSE) or all other lags between 1 to lag (TRUE).

na

A sign which is used to indicate a missing value in a shifted period.

Value

A lagged data series.

See Also

Other Time Series: diff_log(), diff_percentage(), diffinv_log(), diffinv_percentage(), diffinv_simple(), get_season(), invert_differencing(), partition(), period(), stationary()


stschn/deepANN documentation built on June 25, 2024, 7:27 a.m.