lag: Lag

View source: R/transformations.R

lagR Documentation

Lag

Description

Lag by l

Usage

lag(v, l, strategy = "extremes")

Arguments

v

Numeric vector

l

Lag as an integer

strategy

string to determine the NAs generated by the lag should be filled with zeros or with the extremities' values

Details

Applies a lag of l on the input vector, v

Value

The lagged vector v

Examples

lag(c(1,0,0,0,1,0,0,0,2), 1)
lag(c(1,0,0,0,1,0,0,0,2), -2)
lag(c(1,0,0,0,1,0,0,0,2), -2, strategy = 'zero')

linea documentation built on Sept. 15, 2022, 9:06 a.m.

Related to lag in linea...