Determine Neighbourhood Order Matrix from Binary Adjacency Matrix
nbOrder.RdGiven a square binary adjacency matrix, the function
nbOrder determines the integer matrix of neighbourhood orders
(shortest-path distance).
Arguments
- neighbourhood
a square, numeric or logical, and usually symmetric matrix with finite entries (and usually zeros on the diagonal) which indicates vertex adjacencies, i.e., first-order neighbourhood (interpreted as
neighbourhood == 1, not>0).- maxlag
positive scalar integer specifying an upper bound for the neighbourhood order. The default (
Inf) means no truncation (but orders cannot be larger than the number of regions minus 1), whereasmaxlag = 1just returns the input neighbourhood matrix (converted to binary integer mode).
Value
An integer matrix of neighbourhood orders, i.e., the shortest-path
distance matrix of the vertices.
The dimnames of the input neighbourhood matrix are preserved.
See also
nblag from the spdep package