[R] worldmap_region/country problem

Roger Bivand Roger.bivand at nhh.no
Fri Nov 30 12:19:54 CET 2012


 <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
>




More information about the R-help mailing list