Create adjacency matrix from spatial polygons

create_adj_matrix(sh)

Arguments

sh

a spatial polygons object

Value

an adjacency matrix with 1s and 0s

Details

Input sh can be either sf class or SpatialPolygons from sp. Uses spdep package to convert shapefile to neighbor list to adjacency matrix.