Fortify method for classes from the sp package.

Usage

"fortify"(model, data, region = NULL, ...)
"fortify"(model, data, ...)
"fortify"(model, data, ...)
"fortify"(model, data, ...)
"fortify"(model, data, ...)
"fortify"(model, data, ...)
"fortify"(model, data, ...)

Arguments

model
SpatialPolygonsDataFrame to convert into a dataframe.
data
not used by this method
region
name of variable used to split up regions
...
not used by this method

Description

To figure out the correct variable name for region, inspect as.data.frame(model).

Examples

if (require("maptools")) { sids <- system.file("shapes/sids.shp", package="maptools") nc1 <- readShapePoly(sids, proj4string = CRS("+proj=longlat +datum=NAD27")) nc1_df <- fortify(nc1) }
Loading required package: maptools Loading required package: sp Checking rgeos availability: FALSE Note: when rgeos is not available, polygon geometry computations in maptools depend on gpclib, which has a restricted licence. It is disabled by default; to enable gpclib, type gpclibPermit() Regions defined for each Polygons