Description Usage Arguments Details Value Author(s) See Also Examples
Change timestamps to the start of the next period, specified in multiples of seconds.
1 2 3 4 5 6 7 8 | align.time(x, ...)
## S3 method for class 'xts'
align.time(x, n=60, ...)
shift.time(x, n=60, ...)
adj.time(x, ...)
|
x |
object to align |
n |
number of seconds to adjust by |
... |
additional arguments. See details. |
This function is an S3 generic.
The result is to round up to the next
period determined by n modulo x
.
A new object of class(x)
Jeffrey A. Ryan with input from Brian Peterson
1 2 3 4 5 6 7 8 9 10 | 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.