I am struggling a bit with two datasets containing coordinates of individuals and cell towers:
- A first dataset on 9,459 individuals with 1,214 variables including their latitude and longitude in degrees.
- a second dataset on 31,176 cell towers with 4 variables including their latitude and longitude in degrees, and range in meters.
I would like to determine whether an individual is in the range of at least one of the cell towers and create a dummy equal to 1 if it is the case.
However, due to the size of the datasets, I cannot merged them with the cross-join command. I tried using the geosphere
package with the following command:
distm(c(df1$longitude, df2$latitude), c(df2$longitude, df2$latitude), fun= distHaversine)
Unfortunately, it does not work since the two datasets are not equally sized. Any idea of how to solve this issue?