View source: R/time_categories.R
hour_nearest | R Documentation |
Compute the nearest integer hour of day from a DateTimeClasses
object (i.e., nearest neighbour interpolation).
hour_nearest(time)
time |
A vector of times, of the class |
The function returns an integer for each inputted time.
Edward Lavender
hour_nearest(as.POSIXct("2016-01-01 13:01:40")) hour_nearest(as.POSIXct(c("2016-01-01 13:30:00"))) hour_nearest(as.POSIXct(c("2016-01-01 13:30:01"))) hour_nearest(as.POSIXct(c("2016-01-01 13:01:40", NA)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.