diff {timeSeries} | R Documentation |
Difference a 'timeSeries' object
Description
Difference a "timeSeries"
object.
Usage
## S4 method for signature 'timeSeries'
diff(x, lag = 1, diff = 1, trim = FALSE, pad = NA, ...)
Arguments
x |
an object of class |
lag |
an integer indicating which lag to use. |
diff |
an integer indicating the order of the difference. |
trim |
a logical flag. Should |
pad |
a numeric value with which |
... |
currently not used. |
Value
the differenced "timeSeries"
object
See Also
Examples
## Load Microsoft Data Set -
x <- MSFT[1:12, ]
x
## Compute Differences -
diff(x)
## Trimmed Differences -
diff(x, trim = TRUE)
## Padded Differences -
diff(x, trim = FALSE, pad = 0)
[Package timeSeries version 4030.106 Index]