Description Usage Arguments Value
View source: R/spatial_data_functions.R
Builds a matrix describing adjacency between polygons in the
a spatial object. This function is a wrapper of two functions in the
spdep
package.
1 2 3 4 5 6 | build_adjacency_matrix(
poly_sp,
style = "B",
allow_zero_neighbors = TRUE,
manually_add_links = list()
)
|
poly_sp |
A SpatialPolygonsDataFrame object |
style |
One of "B","W","C", or "S". For more information, see the
documentation in the |
allow_zero_neighbors |
[bool, default TRUE] Allow polygons with no neighbors? |
manually_add_links |
[list, default NULL] A list of links to add in addition to those specified by polygon adjacency. This should be formatted as a list where each item is a numeric vector of length 2, specifying the indices of polygons that should be listed as adjacent. The numeric vectors are not sensitive to ordering (so item 'c(1, 3)' is the same as 'c(3, 1)') |
sparse dsCMatrix representing adjacency between polygons in the 'poly_sp' object
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.