library(maptools)
sids.shp <- read.shape(system.file("shapes/sids.shp",
package="maptools"))
sids <- sids.shp$att.data
sidspolys <- Map2poly(sids.shp)
sidscents <- get.Pcent(sids.shp)
data(nc.sids)
plot(sidspolys, border="grey")
plot(ncCR85.nb, sidscents, add=TRUE, col="blue")
plot(sidspolys, border="grey")
plot(ncCC89.nb, cbind(nc.sids$lon, nc.sids$lat),
add=TRUE, col="blue")
Run the code above in your browser using DataLab