diff2: Fast lagged differences
Description
Computes the lagged and iterated differences.
Usage
diff2(x, idxs = NULL, lag = 1L, differences = 1L, ..., useNames = TRUE)
Arguments
- x
- A - numeric- vectorof length
N.
 
- idxs
- A - vectorindicating subset of elements to
operate over. If- NULL, no subsetting is done.
 
- lag
- An - integerspecifying the lag.
 
- differences
- An - integerspecifying the order of
difference.
 
- ...
- Not used. 
- useNames
- If - NA, the default behavior of the 
function about naming support is remained. If- FALSE, 
no naming support is done. Else if- TRUE, names 
attributes of result are set.