powered by
Take lag transformation of a series.
lshift(x, l)
a series to be lagged
the number of lags
the lagged series
lshift assumes that the series are ordered, that there is no missing data, and that the time intervals are even.
lshift
# NOT RUN { x.var <- runif(50) l.1.x.var <- lshift(x.var, 1) l.1.x.var <- lshift(x.var, 2) head(x.var) head(l.1.x.var) head(l.1.x.var) # }
Run the code above in your browser using DataLab