Мы можем использовать fuzzy_join
library(fuzzyjoin)
fuzzy_inner_join(df1, df2, by = c('start' = 'point', 'end' = 'point'),
match_fun = list(`<=`, `>=`))
# A tibble: 5 x 3
# start end point
# <int> <int> <int>
#1 15 20 16
#2 15 20 17
#3 22 32 26
#4 22 32 31
#5 35 52 43
данные
df1 <- structure(list(start = c(15L, 22L, 35L), end = c(20L, 32L, 52L
)), class = "data.frame", row.names = c(NA, -3L))
df2 <- structure(list(point = c(12L, 16L, 17L, 21L, 26L, 31L, 43L)), class = "data.frame", row.names = c(NA,
-7L))