Computes the lagged and iterated differences.
diff2(x, idxs = NULL, lag = 1L, differences = 1L, ..., useNames = TRUE)A vector indicating subset of elements to
operate over. If NULL, no subsetting is done.
An integer specifying the lag.
An integer specifying the order of
difference.
Not used.
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.
diff().
diff2(1:10)
#> [1] 1 1 1 1 1 1 1 1 1