tri2nb {spdep}R Documentation

Neighbours list from tri object

Description

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.

Usage

tri2nb(coords, row.names = NULL)

Arguments

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))

Value

The function returns an object of class nb with a list of integer vectors containing neighbour region number ids.

Author(s)

Roger Bivand Roger.Bivand@nhh.no

See Also

knn2nb

Examples

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")

[Package Contents]