for each row in a data frame, find whether there is a “close” row in another data frame
for each row in a data frame, find whether there is a “close” row in another data frame I have the following data frame: library(dplyr) set.seed(42) df <- data_frame(x = sample(seq(0, 1, 0.1), 5, replace = T), y = sample(seq(0, 1, 0.1), 5, replace = T), z= sample(seq(0, 1, 0.1), 5, replace = T) ) For each row in df , I would like to find out whether there is a row in df2 which is close to it ("neighbor") in all columns, where "close" means that it is not different by more than 0.1 in each column. df df2 So for instance, a proper neighbor to the row (1, 0.5, 0.5) would be (0.9, 0.6, 0.4) . The second data set is (1, 0.5, 0.5) (0.9, 0.6, 0.4) set.seed(42) df2 <- data_frame(x = sample(seq(0, 1, 0.1), 10, replace = T), y = sample(seq(0, 1, 0.1), 10, replace = T), z= sample(seq(0, 1, 0.1), 10, replace = T) ) In this case there is no "neighbor", so Im supposed to get "FALSE" for all rows of df . df My actual data frames are much bigger than th...