Lagged and iterated differences. Equivalent to R's diff(). For a vector (empty when lag * differences is at least the length).
diff()
lag * differences
diff([1, 4, 9, 16]); // [3, 5, 7]diff([1, 4, 9, 16], { differences: 2 }); // [2, 2] Copy
diff([1, 4, 9, 16]); // [3, 5, 7]diff([1, 4, 9, 16], { differences: 2 }); // [2, 2]
Lagged and iterated differences. Equivalent to R's
diff(). For a vector (empty whenlag * differencesis at least the length).