powered by
Change timestamps to the start of the next period, specified in multiples of seconds.
adj.time(x, ...)align.time(x, ...)# S3 method for xts align.time(x, n = 60, ...)shift.time(x, n = 60, ...)
align.time(x, ...)
# S3 method for xts align.time(x, n = 60, ...)
shift.time(x, n = 60, ...)
A new object with the same class as x.
x
Object containing timestamps to align.
Additional arguments. See details.
Number of seconds to adjust by.
Jeffrey A. Ryan with input from Brian Peterson
This function is an S3 generic. The result is to round up to the next period determined by 'n modulo x'.
to.period()
x <- Sys.time() + 1:1000 # every 10 seconds align.time(x, 10) # align to next whole minute align.time(x, 60) # align to next whole 10 min interval align.time(x, 10 * 60)
Run the code above in your browser using DataLab