diff {timeSeries} | R Documentation |
Difference a 'timeSeries' object
Description
Difference a "timeSeries"
object.
Usage
## S3 method for class '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 dataset
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 4032.109 Index]