Description Usage Arguments Value Author(s) Examples
The function finds differences between lists of neighbours, returning a nb
neighbour list of those found
1 |
x |
an object of class |
y |
an object of class |
verbose |
default NULL, use global option value; report regions ids taken from object attribute "region.id" with differences |
A neighbours list with class nb
Roger Bivand Roger.Bivand@nhh.no
1 2 3 4 5 6 7 8 9 10 11 12 | example(columbus)
coords <- coordinates(columbus)
rn <- sapply(slot(columbus, "polygons"), function(x) slot(x, "ID"))
knn1 <- knearneigh(coords, 1)
knn2 <- knearneigh(coords, 2)
nb1 <- knn2nb(knn1, row.names=rn)
nb2 <- knn2nb(knn2, row.names=rn)
diffs <- diffnb(nb2, nb1)
plot(columbus, border="grey")
plot(nb1, coords, add=TRUE)
plot(diffs, coords, add=TRUE, col="red", lty=2)
title(main="Plot of first (black) and second (red)\nnearest neighbours")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.