I am trying to combine the two datasets found here:
One is a world map taken from map_data('world')
and the other is lat/lon of black carbon emissions in 1960. I would like to merge the two so that I can summarize emissions based on country. So far I have been unsuccessful.
My impression is the sp
package is the right tool here. Specifically, the over()
function with the world map being a SpatialPolygonsDataFrame
and the emissions data being a SpatialPointsDataFrame
but I can't seem to get things to work.
Any help is much appreciated. I would also be happy to hear of any suggestions for solid references on GIS and R.
EDIT: I ended up using data(countriesCoarse)
from the rworldmap
package instead of map_data('world')
. This had the advantage of already being a SpatialPolygonsDataFrame
. over()
now appears to be working as desired. I took down the broken link for the data.