Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

zlag

Compute the lag of a vector.


Description

Computes the lag of a vector, with missing elements replaced by NA

Usage

zlag(x, d= 1)

Arguments

x

vector

d

compute the lag d of x

Value

A vector whose k-th element equals x[k-d] with x[t]=NA for t<=0

Author(s)

Kung-Sik Chan

Examples

##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.
x=1:5
zlag(x,2)

TSA

Time Series Analysis

v1.3
GPL (>= 2)
Authors
Kung-Sik Chan, Brian Ripley
Initial release
2020-9-11

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.