Turn strings of H:M to time

time_alter(x, unit = "minute", time_func = lubridate::hm)

Arguments

x

string of class lubridate::hms "HH:MM:SS"

unit

unit to convert to

time_func

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

Examples

time <- c("02:33")
time_alter(time)
#> [1] 153
time_alter(time, "minute")
#> [1] 153