shift: Shift vectors

shiftR Documentation

Shift vectors

Description

Element wise shift of vectors by k positions.

Usage

shift(x, k = 1, ..., fill = NA)

Arguments

x

a vector object.

k

a numeric with the number of elements to shift the Term vector

...

additional arguments. Currently unused.

fill

a numeric value (or NA) to fill the empty created by shifting a vector object.

Value

A shifted vector object of the same type of provided object.

Examples

shift(1:10, fill = 0)

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

fixedincome documentation built on July 9, 2023, 7:28 p.m.