roundPOSIXt | R Documentation |
Round POSIXt objects to specified intervals such as ‘5 minutes’.
roundPOSIXt(t, interval, up = FALSE)
t |
a vector that inherits from class |
interval |
A character string of the form “ |
up |
logical: round down (the default) or up? |
roundPOSIXt
rounds an input of class POSIXt
; it
returns a vector of class POSIXct
.
POSIXct
Enrico Schumann
B.D. Ripley and K. Hornik. Date-Time Classes. R-News, 1(2):8–12, 2001.
DateTimeClasses
times <- as.POSIXct("2012-03-24 22:17:27") + 1:3
roundPOSIXt(times, "10 min")
roundPOSIXt(times, "10 min", TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.