Durations from a Time Series
Computes durations from an object of class 'timeSeries'.
durations(x, trim = FALSE, units = c("secs", "mins", "hours", "days"))
an object of class
a logical value. By default
TRUE, the first missing observation in the return series will be removed.
- a character value or vector which allows to set the units in which the durations are measured. By default durations are measured in seconds.
Durations measure how long it takes until we get the next record in a
timesSeries object. We return a time series in which for each
time stamp we get the length of the period from when we got the
last record. This period is measured in length specified by the
units, for daily data use
- returns an object of class
## Compute Durations in days for the MSFT Sereries - head(durations(MSFT, units = "days")) head(durations(MSFT, trim = TRUE, units = "days")) ## The same in hours - head(durations(MSFT, trim = TRUE, units = "hours"))