Gets the time difference in secs, minutes, hours, days or weeks. Uses difftime() but floors x and y first after coercing to POSIXct and adjusts the timezone of y to match that of x.
Arguments
- x
An object that can be coerced to a POSIXct using dtt_date_time().
- y
An object that can be coerced to a POSIXct using dtt_date_time().
- units
A string of the time units. The possible values are "secs", "minutes", "hours", "days" or "weeks".
- as_difftime
A flag specifying whether to return a difftime vector.