How to find the nearest distance between two different data frames
问题 I am trying to find the nearest distance of locations in dataset 1 to dataset 2. Both data sets are different sizes. Ive looked into using the Haversine function but I'm unsure what I need to do after. 回答1: Since you have not provided a sample of your data, I am going to use the oregon.tract data set from the UScensus2000tract library as a reproducible example. Here is a solution based on fast data.table that I get from this other answer here. # load libraries library(data.table) library