create_adj_matrix | R Documentation |
Create adjacency matrix from spatial polygons
create_adj_matrix(sh)
sh |
a spatial polygons object |
Input sh
can be either sf
class or SpatialPolygons from sp
. Uses spdep
package to convert shapefile to neighbor list to adjacency matrix.
an adjacency matrix with 1s and 0s
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.