| summarize_coverage_by_strata | R Documentation |
Summarize how much area is selected within each stratum (e.g. country or region) in a multiscale H3 system. This function reports a cross-scale coverage metric that avoids double-counting when selected planning units overlap across resolutions.
For each stratum, coverage is reported at a single "native" resolution chosen from the planning units labeled with that stratum.
summarize_coverage_by_strata(
s,
flag_col = "selected_by_resolution_final",
cs_idx,
strata_col = "strata"
)
s |
An |
flag_col |
Name of the 0/1 selection column to summarize. |
cs_idx |
A cross-scale index list returned by
|
strata_col |
Name of the strata column in |
A tibble with one row per stratum and the following columns:
strata
native_res
area_total_native_km2
area_selected_km2
coverage_prop
parent <- "872a1072bffffff"
kids <- c("882a1072b1fffff", "882a1072b3fffff")
s <- data.frame(
h3_address = c(parent, kids),
res = c(7L, 8L, 8L),
strata = c("A", "B", "B"),
area_km2 = c(14, 2, 2),
selected_by_resolution_final = c(0L, 1L, 0L)
)
maps <- build_h3_maps(s, res_levels = c(7L, 8L))
cs_idx <- build_crossscale_index(maps)
summarize_coverage_by_strata(
s,
"selected_by_resolution_final",
cs_idx,
strata_col = "strata"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.