data(atya)
if (require(pixmap, quiet = TRUE)) {
atya.digi <- read.pnm(system.file("pictures/atyadigi.pnm",
package = "ade4"))
atya.carto <- read.pnm(system.file("pictures/atyacarto.pnm",
package = "ade4"))
par(mfrow = c(1,2))
plot(atya.digi)
plot(atya.carto)
points(atya$xy, pch = 20, cex = 2)
}
if (require(maptools, quiet = TRUE) & require(spdep, quiet = TRUE)) {
plot(neig2nb(atya$neig), atya$xy, col = "red", add = TRUE, lwd = 2)
par(mfrow = c(1,1))
}
Run the code above in your browser using DataLab