powered by
Convenience function for fortifying SpatialPolygonsDataFrames for ggplot2 plotting.
ggmapmerge(mapobj, xid)
An S3 dataframe suitable for using in a gggplot2 map
Name of an S4 SpatialPolygonsDataFrame
Name of ID variable in the SpatialPolygonsDataFrame
This function requires maptools to be loaded and gpclibPermit to be TRUE. This is because it depends on the fortify method in ggplot2.
gpclibPermit
TRUE
fortify
ggplot2
if (FALSE) { xx <- maptools::readShapePoly(system.file("shapes/sids.shp", package="maptools")[1], IDvar="FIPSNO") plotobj <- ggmapmerge(xx,"FIPS") }
Run the code above in your browser using DataLab