k5cents / metro

Get DC transit data as R data frames
https://k5cents.github.io/metro/
GNU General Public License v3.0
4 stars 0 forks source link

Use hms columns for non-date time-of-day values (arrivals, etc) #6

Closed k5cents closed 3 years ago

k5cents commented 3 years ago

https://github.com/tidyverse/hms

to_hms <- function(time = "00:00") {
  hms::hms(
    hours = as.integer(substr(time, 1, 2)),
    minutes = as.integer(substr(time, 4, 5))
  )
}

to_hms("05:14")
#> 05:14:00

Created on 2021-02-19 by the reprex package (v1.0.0)