tidyverse / lubridate

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

`make_date` and `make_datetime` not consistant for out of range values #855

Open brunj7 opened 4 years ago

brunj7 commented 4 years ago

related to #839

make_date and make_datetime are not consistent when out of range values are passed as parameters. make_date will generate NA, make_datetime will rollover silently

library(lubridate)
#> 
#> Attaching package: 'lubridate'
#> The following object is masked from 'package:base':
#> 
#>     date
make_datetime(2013, 2, 40)
#> [1] "2013-03-12 UTC"
make_date(2013, 2, 40)
#> [1] NA

Created on 2020-01-31 by the reprex package (v0.3.0.9001)

Kodiologist commented 4 years ago

Worse than the fact that they're inconsistent is that both are fail-silent.

DanChaltiel commented 8 months ago

This is actually a very useful feature to have a rollover, but it is surprising at first and you cannot disable it. IMHO, there should be a rollover=TRUE parameter to opt-in in both functions.