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

2 Answers 2

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.

1
  • I don't know where that shape file is stored. Maybe I'll try another map of function May 19, 2017 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)
1
  • Nice! But it's not working with the proj="albers",param=c(39, 45) which is a area-preserving projection. Aug 31, 2017 at 17:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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