adjacency_matrix {stcos} | R Documentation |
Sparse adjacency matrix between two sets of areas.
Description
A convenience function to convert output from sf::st_touches
to a sparse matrix as defined in the Matrix
package.
Usage
adjacency_matrix(dom)
Arguments
dom |
An |
Details
Returns a matrix A
whose (i,j)th entry contains a 1 if
areal units dom[i,]
and dom[j,]
are adjacent;
0 otherwise.
Value
An adjacency matrix
Examples
data("acs_sf")
dom = acs5_2013[1:4,]
A = adjacency_matrix(dom)
[Package stcos version 0.3.1 Index]