tri2nb {spdep} | R Documentation |
The function uses the tripack
package to convert a matrix of
two-dimensional coordinates
into a neighbours list of class nb
with a list of integer vectors
containing neighbour region number ids.
tri2nb(coords, row.names = NULL)
coords |
matrix of point coordinates with two columns |
row.names |
character vector of region ids to be added to the neighbours list as attribute region.id , default seq(1, nrow(x)) |
The function returns an object of class nb
with a list of integer vectors containing neighbour region number ids.
Roger Bivand Roger.Bivand@nhh.no
require(tripack) data(columbus) col.tri.nb <- tri2nb(coords, row.names=rownames(columbus)) library(maptools) plotpolys(polys, bbs, border="grey") plot(col.tri.nb, coords, add=TRUE) title(main="Raw triangulation links")