Calculate the row differences of a numeric or Boolean vector, matrix, or xts time series.
A numeric or Boolean vector or matrix, or xts time series.
An integer equal to the number of time periods of lag
diff_it() calculates the row differences between
rows that are
lagg rows apart. Positive
lagg means that the
difference is calculated as the current row minus the row that is
lagg rows above. (vice versa for a negative
lagg). This also
applies to vectors, since they can be viewed as single-column matrices. The
leading or trailing stub periods are padded with zeros.
When applied to xts time series, the function
diff.xts() from package
xts, but it
pads the output with zeros instead of with
A vector, matrix, or xts time series. with the same dimensions as the input object.
1 2 3 4 5 6
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.