lagNA | R Documentation |
Convenience function for lagging with NA
lagNA(x, lag = 1, fill = NA)
x |
a vector to be lagged |
lag |
an integer for how much to lag x. lag greater than zero moves values left. lag less than zero moves values right |
fill |
the value to fill at the start or end of the output lagged vector |
a vector the same length as x
lagNA(1:10,3) lagNA(1:10,-3) lagNA(1:10,-3,-99)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.