| compute_overlaps_by_resolution | R Documentation |
For a given 0/1 selection column, counts how many planning units are
simultaneously selected at a finer resolution and at their ancestor cell
at a coarser resolution (using the hierarchy in maps).
For each pair of resolutions r_low < r_high, it reports the number of
co-selected ancestor–descendant pairs, plus a total across all pairs.
compute_overlaps_by_resolution(
s,
flag_col = "selected_by_resolution_final",
maps
)
s |
An |
flag_col |
Name of the 0/1 selection column to analyse
(e.g. |
maps |
A hierarchy list as returned by |
A named integer vector with one entry per resolution pair
(e.g. "5-6", "6-7") and a "total" element.
parent <- "872a1072bffffff"
kids <- c("882a1072b1fffff", "882a1072b3fffff")
s <- data.frame(
h3_address = c(parent, kids),
res = c(7L, 8L, 8L),
selected_by_resolution_final = c(1L, 1L, 0L)
)
maps <- build_h3_maps(s, res_levels = c(7L, 8L))
compute_overlaps_by_resolution(s, "selected_by_resolution_final", maps)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.