title: Use different center than the prime meridian in plotting a world map
body: <p>I am overlaying a world map from the <code>maps</code> package onto a <code>ggplot2</code> raster geometry. However, this raster is not centered on the prime meridian (0 deg), but on 180 deg (roughly the Bering Sea and the Pacific). The following code gets the map and recenters the map on 180 degree:</p>
  
  <pre><code>require(maps)
  world_map = data.frame(map(plot=FALSE)[c("x","y")])
  names(world_map) = c("lon","lat")
  world_map = within(world_map, {
    lon = ifelse(lon &lt; 0, lon + 360, lon)
  })
  ggplot(aes(x = lon, y = lat), data = world_map) + geom_path()
  </code></pre>
  
  <p>which yields the following output:</p>
  
  <p><img src="https://i.stack.imgur.com/DlVSm.png" alt="enter image description here"></p>
  
  <p>Quite obviously there are the lines draw between polygons that are on one end or the other of the prime meridian. My current solution is to replace points close to the prime meridian by NA, replacing the <code>within</code> call above by:</p>
  
  <pre><code>world_map = within(world_map, {
    lon = ifelse(lon &lt; 0, lon + 360, lon)
    lon = ifelse((lon &lt; 1) | (lon &gt; 359), NA, lon)
  })
  ggplot(aes(x = lon, y = lat), data = world_map) + geom_path()
  </code></pre>
  
  <p>Which leads to the correct image. I now have a number of question:</p>
  
  <ol>
  <li>There must be a better way of centering the map on another meridian. I tried using the <code>orientation</code> parameter in <code>map</code>, but setting this to <code>orientation = c(0,180,0)</code> did not yield the correct result, in fact it did not change anything to the result object (<code>all.equal</code> yielded <code>TRUE</code>).</li>
  <li>Getting rid of the horizontal stripes should be possible without deleting some of the polygons. It might be that solving point 1. also solves this point.</li>
  </ol>