lag_delta: Functions to calculate the delta between a value and the...

View source: R/lag_delta.R

lag_deltaR Documentation

Functions to calculate the delta between a value and the lagged or leading value.

Description

Functions to calculate the delta between a value and the lagged or leading value.

Usage

lag_delta(x, na_as_zero = FALSE)

lead_delta(x, na_as_zero = FALSE)

Arguments

x

Numeric vector.

na_as_zero

Should missing elements be set to 0?

Value

Numeric vector.

Author(s)

Stuart K. Grange.

Examples


lag_delta(sample(seq(0:10)))


skgrange/threadr documentation built on May 11, 2024, 12:16 p.m.