Learn R Programming

ecm (version 7.2.0)

lagpad: Lag a vector

Description

Create a vector of the lag of a variable and fill missing values with NA's.

Usage

lagpad(x, k = 1)

Value

The lagged vector with NA's in missing values

Arguments

x

A vector to be lagged

k

The number of lags to output