2

Why is this code creating a bunch of lines crossing the map?

map(database = "world", 
    proj="mercator",
    fill=FALSE,
    bg="white",
    resolution=0)

How can I remove it without changing the projection?

map(database = "world", 
    proj="albers",param=c(39, 45), 
    fill=FALSE,
    bg="white",
    resolution=0)

enter image description here

3

Your polygons (Russia, Aleutians) are crossing the antimeridian (-180W/E) and R isn't able to break them. You need to open the shapefile in QGIS or other GIS and edit the polygons so they break at +/-180.

  • I don't know where that shape file is stored. Maybe I'll try another map of function – M. Beausoleil May 19 '17 at 14:08
2

You can use the wrap argument of the map function to fix the issue.

map(database = "world", 
   proj="mercator",
   fill=FALSE,
   bg="white", 
   wrap =TRUE,
   resolution=0)
  • Nice! But it's not working with the proj="albers",param=c(39, 45) which is a area-preserving projection. – M. Beausoleil Aug 31 '17 at 17:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.