hhmm2dec: Time format conversion

Description Usage Arguments Author(s) Examples

View source: R/MTfuncs_all.R

Description

pass in a character vector of times formatted hh:mm and it will output a vector of numeric times

Usage

1
hhmm2dec(string, time = 24, out = "dd")

Arguments

string

An input vector of times formatted as text (hh:mm)

time

Value 24 or 12. Specifies whether input is 24-hour time, or 12-hour + AM/PM

out

Value "dd" or "dh". Specifies whether output is in decimal days or decimal hours.

Author(s)

Matt Tyers

Examples

1
2
3
4
5
6
times <- c("11:00","12:15","22:30","0:15")
hhmm2dec(times,time=24,out="dd")
hhmm2dec(times,time=24,out="dh")

times12 <- c("11:00AM","12:15PM","2:30PM")
hhmm2dec(times12,time=12)

mbtyers/MTfuncs documentation built on May 22, 2019, 12:58 p.m.