You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have patients that are, according to my data, born in "27-01-44". Like most West-European countries, we're used to dd-mm-yyyy or dd-mm-yy formats in the Netherlands. No problem for lubridate, just:
dmy("27-01-44")
#> [1] "2044-01-27"
Wait, what? Why is the year higher than that of Sys.Date()?
So, maybe not a problem in lubridate. But I think (and others on StackOverflow do too) that it would be great if lubridate could bring a solution to this.
I would suggest to add a new argument to dmy() (and probably others as well), to add a reference date that should be the maximum of the year determination, for example Sys.Date().
The text was updated successfully, but these errors were encountered:
Unfortunately similar argument cannot be incorporated in other functions because in some cases we rely on R's strptime which doesn't have a configuration for this parameter.
This part could be improved when parser is extracted from lubridate (lubridate rewrite).
I think if so many people are running into this problem, there should be a more convenient way.
Unfortunately similar argument cannot be incorporated in other functions because in some cases we rely on R's strptime which doesn't have a configuration for this paramete
Sounds like solvable by an ifelse() 😉 Perhaps use another backend than strptime if people use e.g.
In principle, strptime is needed only for parsing non-numeric months and week days in non english locales, so indeed, a half baked solution to this might be reasonable as it covers 99% of use cases.
I have patients that are, according to my data, born in
"27-01-44"
. Like most West-European countries, we're used to dd-mm-yyyy or dd-mm-yy formats in the Netherlands. No problem forlubridate
, just:Wait, what? Why is the year higher than that of
Sys.Date()
?This has been a problem for years, proven by this question from 2012 until this answer from September 2019.
So what about base R?
So, maybe not a problem in
lubridate
. But I think (and others on StackOverflow do too) that it would be great iflubridate
could bring a solution to this.I would suggest to add a new argument to
dmy()
(and probably others as well), to add a reference date that should be the maximum of the year determination, for exampleSys.Date()
.The text was updated successfully, but these errors were encountered: