View source: R/load-multiscale-feature.R
| multiscale_feature_cols | R Documentation |
Returns the multiscale feature columns created by
load_multiscale_feature() in a named vector that can be passed directly to
the feature_cols argument of build_multiscale_objective_data().
multiscale_feature_cols(pu, names_as = c("native", "feature"))
pu |
A planning-unit object containing a |
names_as |
Character; use |
With names_as = "native", the vector is named using the native feature
columns, such as r8_habitat. With names_as = "feature", it is named using
the feature names supplied to load_multiscale_feature().
A named character vector mapping native feature columns or feature names to their corresponding multiscale feature columns.
Other multiscale minimum-set:
add_multiscale_min_set(),
add_multiscale_min_set_objective(),
add_multiscale_relative_targets(),
build_multiscale_atoms(),
build_multiscale_feature_atoms(),
build_multiscale_objective_data(),
eval_multiscale_atom_solution(),
load_multiscale_feature()
parent <- "872a1072bffffff" # Create one H3 parent and one of its children.
child <- h3jsr::get_children(parent, 8L, simple = TRUE)
child <- as.character(unlist(child, use.names = FALSE))[1]
h3_vec <- c(parent, child)
pu <- h3jsr::cell_to_polygon(h3_vec, simple = FALSE)
pu <- pu[match(h3_vec, pu$h3_address), ]
pu$res <- c(7L, 8L)
maps <- build_h3_maps(pu,res_levels = c(7L, 8L))
feature <- sf::st_sf(geometry = sf::st_geometry(pu[2, ]))
pu <- load_multiscale_feature(pu = pu,source = feature,
native_res = 8L,maps = maps,feature_name = "habitat")
# Map native feature columns to optimization columns.
multiscale_feature_cols(pu)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.