%in% very slow for Date class since R 4.3
On Thu, 26 Jun 2025, Dirk Eddelbuettel writes:
On 25 June 2025 at 07:11, Kurt Hornik wrote: | >>>>> hormutz screed writes: | | Thanks. Makes sense to me, needs some discussion in R Core ... Nice to see this in NEWS [1]: CHANGES IN R-devel BUG FIXES ?<Date> %in% set? has become as fast again, as it was before R 4.3.0, via new S3 method ?mtfrm.Date?. Dirk [1] https://developer.r-project.org/blosxom.cgi/R-devel via the RSS feed
As a remark -- not a complaint ;-) --, in R 4.5.1:
match("2025-01-01", as.Date("2025-01-01"))
## [1] 1
which is, in a way, consistent with
"2025-01-01" == as.Date("2025-01-01")
## [1] TRUE
In R-devel (2025-06-26 r88362):
match("2025-01-01", as.Date("2025-01-01"))
## [1] NA
"2025-01-01" == as.Date("2025-01-01")
## [1] TRUE
Enrico Schumann Lucerne, Switzerland https://enricoschumann.net