Learn R Programming

spacetime (version 1.3-2)

delta: find default time interval end points when intervals are regular

Description

find default time interval end points when intervals are regular

Usage

delta(x)

Value

sequence of 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.

Arguments

x

object of class xts, or of another class that can be coerced into POSIXct

;

Author

Edzer Pebesma

Details

to find the interval size for the last observation (which has no next observation), x needs to be at least of length 2.

References

https://www.jstatsoft.org/v51/i07/

Examples

Run this code
x = as.POSIXct("2000-01-01") + (0:9) * 3600
delta(x)

Run the code above in your browser using DataLab