eeptools (version 1.2.2)

ggmapmerge: A depcrecated method for fortifying SpatialPolygonsDataFrames for plotting

Description

Convenience function for fortifying SpatialPolygonsDataFrames for ggplot2 plotting.

Usage

ggmapmerge(mapobj, xid)

Arguments

mapobj

Name of an S4 SpatialPolygonsDataFrame

xid

Name of ID variable in the SpatialPolygonsDataFrame

Value

An S3 dataframe suitable for using in a gggplot2 map

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
# NOT RUN {
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