eeptools (version 1.2.4)

ggmapmerge: A depcrecated method for fortifying SpatialPolygonsDataFrames for plotting

Description

Convenience function for fortifying SpatialPolygonsDataFrames for ggplot2 plotting.

Usage

ggmapmerge(mapobj, xid)

Value

An S3 dataframe suitable for using in a gggplot2 map

Arguments

mapobj

Name of an S4 SpatialPolygonsDataFrame

xid

Name of ID variable in the SpatialPolygonsDataFrame

Details

This function requires maptools to be loaded and gpclibPermit to be TRUE. This is because it depends on the fortify method in ggplot2.

Examples

Run this code
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