Description Usage Arguments Details Value Author(s) See Also Examples
Set operations on neighbors list objects
1 2 3 4 | intersect.nb(nb.obj1,nb.obj2)
union.nb(nb.obj1,nb.obj2)
setdiff.nb(nb.obj1,nb.obj2)
complement.nb(nb.obj)
|
nb.obj |
a neighbor list created from any of the neighborhood list funtions |
nb.obj1 |
a neighbor list created from any of the neighborhood list funtions |
nb.obj2 |
a neighbor list created from any of the neighborhood list funtions |
These functions perform set operations on each element of a neighborlist. The arguments must be neighbor lists created from the same coordinates, and the region.id attributes must be identical.
nb.obj |
A new neighborlist created from the set operations on the input neighbor list(s) |
Nicholas Lewin-Koh nikko@hailmail.net
intersect.nb
, union.nb
,
setdiff.nb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | example(columbus)
coords <- coordinates(columbus)
col.tri.nb <- tri2nb(coords)
oldpar <- par(mfrow=c(1,2))
col.soi.nb <- graph2nb(soi.graph(col.tri.nb, coords))
plot(columbus, border="grey")
plot(col.soi.nb, coords, add=TRUE)
title(main="Sphere of Influence Graph")
plot(columbus, border="grey")
plot(complement.nb(col.soi.nb), coords, add=TRUE)
title(main="Complement of Sphere of Influence Graph")
par(mfrow=c(2,2))
col2 <- droplinks(col.gal.nb, 21)
plot(intersect.nb(col.gal.nb, col2), coords)
title(main="Intersect")
plot(union.nb(col.gal.nb, col2), coords)
title(main="Union")
plot(setdiff.nb(col.gal.nb, col2), coords)
title(main="Set diff")
par(oldpar)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.