difftimeDate | R Documentation |
Returns the difference of two 'timeDate' objects.
difftimeDate(time1, time2,
units = c("auto", "secs", "mins", "hours", "days", "weeks"))
time1 , time2 |
two objects objects of class |
units |
a character string denoting the date/time units in which the results are desired. |
difftimeDate
, takes a difference of two "timeDate"
objects and returns an object of class "difftime"
with an
attribute indicating the units.
## 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)])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.