I'm using ggplot to create a map using the Robinson projection. Ultimately, I'll be plotting individual countries, but I need to provide continent boundaries as a background layer (since some countries will not be plotted). I can successfully plot the two layers of my data (continents + countries) with one of mapproj's built-in projections:
However, when I convert the shapefile's CRS to Robinson, I get strange artifacts in the continents. Here's a minimal working example:
library(dplyr) library(ggplot2) library(rgdal) # Get Natural Earth shapefiles download.file(url="http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/cultural/ne_110m_admin_0_countries.zip", "ne_110m_admin_0_countries.zip", "auto") unzip("ne_110m_admin_0_countries.zip") file.remove("ne_110m_admin_0_countries.zip") # Load and fortify regular data world

However, when I convert the shapefile's CRS to Robinson, I get strange artifacts in the continents. Here's a minimal working example:
library(dplyr) library(ggplot2) library(rgdal) # Get Natural Earth shapefiles download.file(url="http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/cultural/ne_110m_admin_0_countries.zip", "ne_110m_admin_0_countries.zip", "auto") unzip("ne_110m_admin_0_countries.zip") file.remove("ne_110m_admin_0_countries.zip") # Load and fortify regular data world