
Last chance! 50% off unlimited learning
Sale ends in
as.data.frame(model)
.## S3 method for class 'SpatialPolygonsDataFrame':
fortify(model, data,
region = NULL, ...) ## S3 method for class 'SpatialPolygons':
fortify(model, data, ...)
## S3 method for class 'Polygons':
fortify(model, data, ...)
## S3 method for class 'Polygon':
fortify(model, data, ...)
## S3 method for class 'SpatialLinesDataFrame':
fortify(model, data,
...)
## S3 method for class 'Lines':
fortify(model, data, ...)
## S3 method for class 'Line':
fortify(model, data, ...)
SpatialPolygonsDataFrame
to convert
into a dataframe.if (require("maptools")) {
sids <- system.file("shapes/sids.shp", package="maptools")
nc1 <- readShapePoly(sids,
proj4string = CRS("+proj=longlat +datum=NAD27"))
nc1_df <- fortify(nc1)
}
Run the code above in your browser using DataLab