# NOT RUN {
require(maptools)
nc.sids <- readShapePoly(system.file("etc/shapes/sids.shp", package="spdep")[1],
ID="FIPSNO", proj4string=CRS("+proj=longlat +ellps=clrk66"))
rn <- sapply(slot(nc.sids, "polygons"), function(x) slot(x, "ID"))
ncCC89_nb <- read.gal(system.file("etc/weights/ncCC89.gal", package="spdep")[1],
region.id=rn)
ncCR85_nb <- read.gal(system.file("etc/weights/ncCR85.gal", package="spdep")[1],
region.id=rn)
# }
# NOT RUN {
plot(nc.sids, border="grey")
plot(ncCR85_nb, coordinates(nc.sids), add=TRUE, col="blue")
plot(nc.sids, border="grey")
plot(ncCC89_nb, coordinates(nc.sids), add=TRUE, col="blue")
# }
Run the code above in your browser using DataLab