Learn R Programming

mvbutils (version 2.5.4)

Hours: Sorting out times and time difference

Description

These functions enforce seconds-based calculations of time differences. Hours, Minutes, and Seconds all return the obvious number of seconds, together with the attribute unit="seconds". Further, when you load mvbutils, the system functions -.POSIXt, +.POSIXt, and difftime, get silently replaced by equivalents that force all calculations to be done in seconds. Actually, you can still force difftime to calculate in different units, via its units argument, but the default is now "seconds" rather than "auto".

Usage

Hours( x)
 Minutes( x)
 Seconds( x)

Arguments

x
numeric vector in the units of the name of the called function.

Value

  • A numeric vector of the same length as x, giving the equivalent timespan in seconds, together with an attribute unit="seconds".