diff-Term-method: Calculate lagged differences of Term objects

diff,Term-methodR Documentation

Calculate lagged differences of Term objects

Description

diff returns a Term vector with lagged differences.

Usage

## S4 method for signature 'Term'
diff(x, lag = 1, ..., fill = NULL)

Arguments

x

a Term object.

lag

a numerix indicating which lag to use.

...

additional arguments. Currently unused.

fill

a numeric value (or NA) to fill the empty created by applying diff to a Term object.

Value

A new Term object with lagged differences of the given Term object.

Examples

t <- term(1:10, "months")
diff(t)

wilsonfreitas/R-fixedincome documentation built on June 30, 2023, 7:46 a.m.