View source: R/transformations.R
| lag | R Documentation |
Lag by l
lag(v, l, strategy = "extremes")
v |
Numeric vector |
l |
Lag as an integer |
strategy |
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
The lagged 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')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.