Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

base-difftimeDate

Difference of two 'timeDate' Objects


Description

Returns a difference of two 'timeDate' objects.

Usage

difftimeDate(time1, time2, 
    units = c("auto", "secs", "mins", "hours", "days", "weeks"))

Arguments

time1, time2

two objects objects of class timeDate.

units

a character string denoting the date/time units in which the results are desired.

Value

The function, difftimeDate, takes a difference of two timeDate objects and returns an object of class "difftime" with an attribute indicating the units.

Examples

## Create Character Vectors:
   dts = c("1989-09-28", "2001-01-15", "2004-08-30", "1990-02-09")
   dts
   
## timeDate - 
   GMT = timeDate(dts, zone = "GMT", FinCenter = "GMT") 
   GMT

## diff - 
   # Suitably Lagged and Iterated Differences:
   difftimeDate(GMT[1:2], GMT[-(1:2)])

timeDate

Rmetrics - Chronological and Calendar Objects

v3043.102
GPL (>= 2)
Authors
Diethelm Wuertz [aut], Tobias Setz [cre], Yohan Chalabi [ctb], Martin Maechler [ctb], Joe W. Byers [ctb]
Initial release
2018-02-21

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.