data(elec88, package = "ade4")
## mapping without data
g1 <- s.Spatial(elec88$Spatial)
if (FALSE) {
if(require(sp, quietly = TRUE)) {
## mapping with data
obj <- SpatialPolygonsDataFrame(Sr = elec88$Spatial, data = elec88$tab)
g2 <- s.Spatial(obj)
g3 <- s.Spatial(obj, nclass = 2, col = c("red", "blue"))
}
}
Run the code above in your browser using DataLab