I'm using the default world map from
rworldmaps as a background layer for a bunch of plots done with
ggplot2. In order to do this I have to "fortify" the object returned by
getMap() - this converts it to a format ggplot understands.
> library(maptools) > library(rworldmap) > library(ggplot2)
and the 'rgeos' package also installed, this works, but gives me a message which makes it sound like I really ought to specify the "region=" argument:
> world <- fortify(getMap()) Regions defined for each Polygons
I want the background layer to show country borders, so I think I ought to specify
region="ADMIN", but this fails:
> world <- fortify(getMap(), region="ADMIN") Error: IllegalArgumentException: Points of LinearRing do not form a closed linestring
I get the same error message for other plausible region= settings (NAME, ISO_A2, REGION, continent, etc).
What is going on and what is the correct way to do what I want?