"fortify"(model, data, region = NULL, ...)"fortify"(model, data, ...)"fortify"(model, data, ...)"fortify"(model, data, ...)"fortify"(model, data, ...)"fortify"(model, data, ...)"fortify"(model, data, ...)
SpatialPolygonsDataFrame
to convert into a dataframe.To figure out the correct variable name for region, inspect
as.data.frame(model)
.
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 Warning message: there is no package called ‘maptools’