Takes a vector of HH:MM (HH:MM:SS) information and categorizes these by a 4 level factor of time of day.
time_factor(x, time_func = lubridate::hms, tod = time_of_day())
character vector of times
a function to convert x to a lubridate time vector. Default is lubridate::hms
list defining when the breakpoints for the various time of day distinctions.
factor vector
time_factor(c("12:23", "15:59", "22:10", "8:13"))
#> Warning: There was 1 warning in `mutate()`.
#> ℹ In argument: `time = time_func(x)`.
#> Caused by warning in `.parse_hms()`:
#> ! Some strings failed to parse, or all strings are NAs
#> [1] <NA> <NA> <NA> <NA>
#> Levels: morning < afternoon < evening < night