lubridate (version 1.5.0)

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

Description

Transforms a character or numeric vectors into a period object with the specified number of hours and minutes. Arbitrary non-numeric text can separate hours and minutes. After hours and minutes have been parsed, the remaining input is ignored.

Usage

hm(..., quiet = FALSE)

Arguments

...
character or numeric vectors of hour minute pairs
quiet
logical. When TRUE function evalueates without displaying customary messages.

Value

  • a vector of class Period

See Also

hms, ms

Examples

Run this code
hm(c("09:10", "09:02", "1:10"))
## [1] "9H 10M 0S" "9H 2M 0S"  "1H 10M 0S"
hm("7 6")
## [1] "7H 6M 0S"
hm("6,5")
## [1] "6H 5M 0S"

Run the code above in your browser using DataCamp Workspace