Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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)

Arguments

x

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

;

Details

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

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.

Author(s)

Edzer Pebesma

References

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

Examples

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

spacetime

Classes and Methods for Spatio-Temporal Data

v1.2-4
GPL (>= 2)
Authors
Edzer Pebesma [aut, cre] (<https://orcid.org/0000-0001-8049-7069>), Benedikt Graeler [ctb], Tom Gottfried [ctb], Robert J. Hijmans [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.