delta(x)
xts
, or of another class that can
be coerced into POSIXct
POSIXct
time stamps, indicating the end
of the time interval, given by the next observation in x
.
The last interval gets the same width of the one-but-last interval.
x
needs to be at least of length 2.
x = as.POSIXct("2000-01-01") + (0:9) * 3600
delta(x)
Run the code above in your browser using DataLab