The plot method for spatial polygons takes the following arguments:
x: a SpatialPolygons object
col: a vector of colour values
border: default par("fg"); the colour to draw the border
add: default FALSE; if TRUE, add to existing plot
xlim, ylim: default NULL; ranges for the plotted x and y values
xpd: default NULL; controls clipping, see par
density: default NULL; the density of shading lines, in lines per inch, see polygon
angle: default 45; the slope of shading lines, given as an angle in degrees (counter-clockwise), see polygon
pbg: default NULL, set to par("bg") by default transparent ; the colour to paint holes
axes: default FALSE; draw axes
lty: default par("lty"); border line type
...: other arguments passed through
setParUsrBB: default FALSE; see Spatial-class for further details
usePolypath: default NULL to set from option value; use polypath for hole-handling in plot
rule: default NULL to set from option value; character value specifying the path fill mode, see polypath
The options for usePolypath and rule may be retrieved with get_Polypath (default TRUE on package load) and get_PolypathRule (default winding on package load), and set with set_Polypath and set_PolypathRule
The class definitions used for polygons in sp do not accord with those of the simple features specification of the Open Geospatial Consortium. The rgeos package, an interface to Geometry Engine -- Open Source (GEOS), uses this specification, in which each hole (interior ring) must be associated with its containing exterior ring. In order to avoid introducing incompatible changes into the class definition of Polygons objects, a comment has been added as a single character string to each such object. Here we can trust the data source to assign the hole status correctly, and use round-trip coercion to sf to add such comments to each Polygons member of the polygons slot of this SpatialPolygons object. Exterior rings are coded zero, while interior rings are coded with the 1-based index of the exterior ring to which they belong. SpatialPolygons objects created by reading using sf or terra have the comments set on input, as OGR also uses SFS.
Refer to Bivand et al. (2013), pages 47-48 and 132-133 for a further discussion.
Note
rbind calls the function SpatialPolygons, where it is checked that all IDs are unique. If rbind-ing SpatialPolygons without unique IDs, it is possible to set the argument makeUniqueIDs = TRUE, although it is preferred to change these explicitly with spChFIDs.
References
Roger Bivand, Edzer Pebesma and Virgilio Gomez-Rubio, 2013. Applied spatial data analysis with R, Second edition. Springer, NY. https://asdar-book.org/