timeMaster: Transform time values between different formats

View source: R/rMEA_util.R

timeMasterR Documentation

Transform time values between different formats

Description

This function allows to

Usage

timeMaster(
  baseTime,
  add = 0,
  out = c("auto", "hour", "min", "sec"),
  baseSep = "[\\.,:,\\,',-,\"]"
)

Arguments

baseTime, add

either integer of seconds or a time string in the format h:m:s, m:s, or s, with or without leading zeroes

out

a character string indicating the format of the output. One of "auto" (the default which tries to keep the format of 'baseTime'), "hour", "min", or "sec": can be abbreviated.

baseSep

a character string or a regular expression identifying separators in baseTime

Examples

## Adding seconds to minutes
timeMaster(30, add="10:00", out = "min")

## Adding strings to integer seconds and returning a numeric value
timeMaster(30, add="10:00")

## Automatic detection of format
timeMaster("01:30:55",add="10:00",out = "auto")

rMEA documentation built on March 18, 2022, 5:41 p.m.