time_factor: Factor time of day

View source: R/time-funcs.R

time_factorR Documentation

Factor time of day

Description

Takes a vector of HH:MM (HH:MM:SS) information and categorizes these by a 4 level factor of time of day.

Usage

time_factor(x, time_func = lubridate::hms, tod = time_of_day())

Arguments

x

character vector of times

time_func

a function to convert x to a lubridate time vector. Default is lubridate::hms

tod

list defining when the breakpoints for the various time of day distinctions.

Value

factor vector

Examples

time_factor(c("12:23", "15:59", "22:10", "8:13"))

LCBC-UiO/Questionnaires documentation built on July 18, 2023, 6:45 p.m.