lubridate (version 0.1)

hm: Create a period with the specified number of hours and minutes...

Description

Create a period with the specified number of hours and minutes

Usage

hm(...)

Arguments

...
a character vector of hour minute pairs

Value

  • a vector of period objects

Details

Transforms a character string into a period object with the specified number of hours and minutes. hm() recognizes all non-alphanumeric separators of length 1 with the exception of ".".

See Also

hms, ms

Examples

Run this code
x <- c("09:10", "09:02", "1:10")
hm(x)
# [1] 9 hours and 10 minutes   9 hours and 2 minutes   1 hour and 10 minutes
hm("7 6")
# [1] 7 hours and 6 minutes
hm("6,5")
# [1] 6 hours and 5 minutes}

Run the code above in your browser using DataCamp Workspace