0

is it possible to merge datasets in R by longitude and latitude?

I am seeking to merge two geocoded datasets by AidData, containing information on development projects all around the globe. I would like to connect projects which are within a radius of 50km of a project from the other dataset. Columns in the dataframes look something like this:

Dataframe   place_name          latitude    longitude
World Bank Dar es Salaam        -6.82349    39.26951
China      Dar es Salaam Region -6.83522    39.19597

The most problematic issue is that a 50km radius is not equating to a specific, non-varying change in latitude or longitude everywhere. If that would be the case, the problem could be resolved rather easily by setting an upper and lower boundary for each project, and merging it with each other projects that falls within those boundaries.

Is it possible to merge these data by latitude and longitude in R at all?

  • 1
    This is perfectly possible. For starters, look at `sf::st_join()`. When working with spatial data in R, the `sf`-package is a very useful set of tools to use. – Wimpel Mar 24 '21 at 13:00
  • Look at this post which is very similar to your problem: https://stackoverflow.com/questions/31668163/geographic-geospatial-distance-between-2-lists-of-lat-lon-points-coordinates – marcguery Mar 25 '21 at 09:58

0 Answers0