The new dplyr version, 1.1.0, introduces the "rolling join", which finds "the closest match". It is based on inequalities: for example, it can find the value of data frame B that is closest from below or closest from above to each value in data frame A. To do this it uses the syntax join_by(closest(a <= b)). Examples are given in the tidyverse blog post: dplyr 1.1.0 is coming soon
My question is whether there is an analogous function that allows us to find the closest match. My intuition suggests join_by(closest(a == b)), but that does not work.
As far as I could tell, there isn't one. It is not like there aren't other ways of achieving this goal, but given that we already have the join_by(closest(a <= b)) syntax, it would be very nice to also be able to do join_by(closest(a == b))