powered by
Lag by l
l
lag(v, l, strategy = "extremes")
The lagged vector v
v
Numeric vector
Lag as an integer
string to determine the NAs generated by the lag should be filled with zeros or with the extremities' values
Applies a lag of l on the input vector, v
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')
Run the code above in your browser using DataLab