lagpad: Lags a vector

Description Usage Arguments Value Author(s)

View source: R/lagpad.R

Description

Displaces an array the first or last k positions and fill the dislpaced empty spots with a specific value.

Usage

1
lagpad(x,k,default)

Arguments

x

array to be displaced.

k

the number of positions to displace. If its negative it would displace from the end.

default

value to fill the displaced empty spots. It takes 0 by default.

Value

Returns an array of same length as x, with x's values displaced k positions and the default values where its supposed to.

Author(s)

Daniel Fischer


danielfm123/dftools documentation built on July 17, 2021, 1 p.m.