Skip to content
Prev 60956 / 63424 Next

Should `as.difftime()` convert integer input to double?

Forcing difftime's payload to be numeric would avoid anomalies like
Time difference of NA secs
Warning message:
In e2 * unclass(e1) : NAs produced by integer overflow
Time difference of 12345678900 secs

Note that there are packages (e.g., fst, a serialization package) which can
(in C++ code) understand and create difftimes with integer payloads, so you
may have trouble completely getting rid of such things.

-Bill
On Tue, Aug 9, 2022 at 11:26 AM Davis Vaughan <davis at rstudio.com> wrote: