An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20121129/87700907/attachment.pl>
worldmap_region/country problem
2 messages · anna.fechner at de.pwc.com, Roger Bivand
1 day later
<anna.fechner <at> de.pwc.com> writes:
Dear R community, I'm trying to graphically illustrate my data with a worlmap. Unfortunately, my data is partly on country basis and partly on regional basis (e.g. certain African countries are aggregated to one region). I am using the package rwoldmap. The data on country basis can be mapped, but our defined regions cannot be identified in R. Therefore, all the countries in these regions are not plotted. Is there a way to define regions (for example 'Rest of East-Europe') and to map a combination of these defined regions and individual countries in one worldmap? Is it possible to not display borderlines between some countries but to show the borders between others?
Yes, use gUnaryUnion() in rgeos, or the equivalent unionSpatialPolygons() in maptools, which calls gUnaryUnion(). These create new, merged polygons, and should then be associated with the data for the entities you are using. Be careful not to use gpclib union functions as they are prohibited for commercial purposes. Please follow up on the R-sig-geo list if need be. Roger
Thank you very much for your help! Anna Fechner PricewaterhouseCoopers Aktiengesellschaft Wirtschaftspr?fungsgesellschaft