Revising the code on a conditional join with a lookup table (mapping)

If you want to stay in the tidy-world, you could check out the fuzzyjoin package which allows you to specify non exact matching joins.

There are some other R solutions to a similar problem written up here, including using data.table::foverlaps().

https://www.mango-solutions.com/in-between-a-rock-and-a-conditional-join/

1 Like