Determine Neighbourhood Order Matrix from Binary Adjacency Matrix
Given a square binary adjacency matrix, the function
nbOrder determines the integer matrix of neighbourhood orders
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
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), whereas
maxlag = 1just returns the input neighbourhood matrix (converted to binary integer mode).
An integer matrix of neighbourhood orders, i.e., the shortest-path
distance matrix of the vertices.
dimnames of the input
neighbourhood matrix are preserved.
nblag from the spdep package