I am attempting to convert a spatial polygon object in R to a map object. I have managed to do so using previously answered questions, most specifically (Converting between SpatialPolygons* and map objects), but I am having the same problem as the person in this thread: I get strange polygon linkings that render the map unusable. The problem is that each some ids (provinces) consist of several polygons, e.g. the islands. The SpatialPolygonsDataFrame has information to tell that these separate polygons are the same id but should not be connected by lines. By converting to map, that information is lost. In your workaround, you’re only adding NAs between ids, not between all separate polygons. The trick is to generate a unique id for all separate piece, so a NA can be added after each little piece. The xx created by join contains a field called piece. It seems this field has a separate number for each polygon within a single id. So, for instance polygon with id == 4 consists of 3 pieces, e.g. 3 islands. A unique id for all polygons can then be generated by: It takes the ID of each province * 1000 plus the id of each piece. The maximum of pieces within a polygon for India is 212. The complete code is then: Source.