View source: R/add-multiscale-relative-targets.R
| add_multiscale_relative_targets | R Documentation |
Adds feature representation targets expressed as proportions between zero and one of the total amount of each feature in the multiscale planning data.
add_multiscale_relative_targets(x, targets, data)
x |
A single-zone |
targets |
A numeric value or vector of proportions between zero and one. Supply either one value for all features or one value per problem feature. A named vector is matched to the problem feature names. |
data |
A |
Relative targets specify the minimum proportion of each feature that should be represented by the solution. Feature totals are calculated across the nested planning-unit hierarchy, allowing representation secured at different resolutions to contribute toward the same target.
A single target value is applied to every feature. An unnamed vector follows the feature order in the problem, and a named vector is matched by feature name and must provide a value for every feature.
An updated ConservationProblem object with the targets added.
Other multiscale minimum-set:
add_multiscale_min_set(),
add_multiscale_min_set_objective(),
build_multiscale_atoms(),
build_multiscale_feature_atoms(),
build_multiscale_objective_data(),
eval_multiscale_atom_solution(),
load_multiscale_feature(),
multiscale_feature_cols()
h3_vec <- c("872a1072bffffff","882a1072b1fffff","882a1072b3fffff")
pu <- h3jsr::cell_to_polygon(h3_vec, simple = FALSE)
pu <- pu[match(h3_vec, pu$h3_address), ]
pu$res <- c(7L, 8L, 8L)
pu$area_km2 <- c(14, 2, 2)
pu$A <- c(3, 1, 2)
pu$B <- c(6, 2, 1)
maps <- build_h3_maps(pu)
ms_data <- build_multiscale_objective_data(pu, maps, feature_cols = c(A = "A", B = "B"))
p <- prioritizr::problem(pu,features = c("A", "B"),cost_column = "area_km2")
p <- add_multiscale_min_set_objective(p,ms_data)
p <- add_multiscale_relative_targets(p,c(B = 1/2, A = 2/3),ms_data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.