Computes the lag of a vector, with missing elements replaced by NA
zlag(x, d= 1)
compute the lag d of x
A vector whose k-th element equals x[k-d] with x[t]=NA for t<=0
1 2 3 4 5
##---- Should be DIRECTLY executable !! ---- ##-- ==> Define data, use random, ##-- or do help(data=index) for the standard data sets. x=1:5 zlag(x,2)
Loading required package: leaps Loading required package: locfit locfit 1.5-9.1 2013-03-22 Loading required package: mgcv Loading required package: nlme This is mgcv 1.8-17. For overview type 'help("mgcv-package")'. Loading required package: tseries Attaching package: 'TSA' The following objects are masked from 'package:stats': acf, arima The following object is masked from 'package:utils': tar  NA NA 1 2 3
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.