tidyverse / lubridate

Make working with dates in R just that little bit easier
https://lubridate.tidyverse.org
GNU General Public License v3.0
724 stars 207 forks source link

Duration constructors need to forcibly coerce to double #1131

Open DavisVaughan opened 1 year ago

DavisVaughan commented 1 year ago
library(lubridate)

typeof(dseconds(as.integer(1)))
#> [1] "integer"
typeof(seconds(as.integer(1)))
#> [1] "double"

This is done in Period constructors but not in Duration constructors.

This causes issues with vctrs, because we expect that duration objects are built on double vectors https://github.com/r-lib/vctrs/issues/1862 (we've experienced and patched a few issues like this in the past)