View source: R/multiscale_connect_matrix.R
| build_multiscale_connectivity_matrix | R Documentation |
Constructs a sparse connectivity matrix linking each finer planning unit
to its ancestor at the next coarser resolution represented in maps. This is
typically used as the data input to add_multiscale_connectivity_penalties().
build_multiscale_connectivity_matrix(maps, symmetric = TRUE)
maps |
A list as returned by |
symmetric |
Logical; if |
A Matrix::dgCMatrix connectivity matrix of size n_pu × n_pu.
# Minimal 2-resolution parent-child example
h3_child <- "8a2a1072b59ffff"
h3_parent <- "892a1072b5bffff"
h3_vec <- c(h3_parent, h3_child)
h3_res <- h3jsr::get_res(h3_vec, simple = TRUE)
maps <- build_h3_maps(s_or_h3 = h3_vec, res_vec = h3_res)
conn <- build_multiscale_connectivity_matrix(maps)
conn
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.