1

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.

Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
johnson-shuffle
  • 1,023
  • 5
  • 11
  • I could not see what you have in your Rdata file. But, are you thinking about something like [this](http://stackoverflow.com/questions/21748852/choropleth-map-in-ggplot-with-polygons-that-have-holes)? This is just an example. But, this may help you a bit. – jazzurro Oct 09 '14 at 15:51
  • Your file does not import properly for me either. Can you save it again, or better just provide a link to the second file in its original format (cvs or whatever). – jlhoward Oct 09 '14 at 18:18
  • Sorry for the data fail. Thanks for taking a look. – johnson-shuffle Oct 10 '14 at 01:28

0 Answers0