Computes cell-wise ensemble summaries across parameter sweep runs, supporting deterministic modal classification and per-class proportion layers.
Usage
geomorphon_ensemble(
sweep_obj,
method = c("modal", "proportions"),
form = NULL,
classes = NULL,
ties = "lowest",
...
)Arguments
- sweep_obj
An object of class
geomorphon_sweep, a list ofSpatRasterobjects, or a multi-layerSpatRasterrepresenting runs of a parameter sweep.- method
character. Aggregation method:
"modal"(default) computes the modal landform class per cell;"proportions"computes per-class proportions across non-NA runs.- form
character or numeric. Which form taxonomy to aggregate when multiple exist in
sweep_obj(e.g."forms10","forms6","forms5","forms4"). Defaults to the first or only form available.- classes
integer or character vector. Which landform classes to compute proportions for when
method = "proportions". Defaults toNULL, which evaluates all reachable classes forform(10 forforms10, 6 forforms6, 5 forforms5, 4 forforms4), matchinggeomorphon_categories().- ties
character. Tie-breaking rule for
method = "modal". Passed toterra::modal(), default is"lowest"for deterministic tie-breaking.- ...
Additional arguments passed to methods.
Value
A SpatRaster (or matrix / list of matrices) containing the aggregated
ensemble. For method = "modal", returns a single layer with geomorphon factor
levels and color table applied. For method = "proportions", returns multi-layer
proportions named by class.
Examples
if (FALSE) { # \dontrun{
library(terra)
data("salton", package = "rgeomorphon")
dem <- rast(salton)
crs(dem) <- attr(salton, "crs")
ext(dem) <- attr(salton, "extent")
grid <- data.frame(search = c(3, 5), skip = c(0, 1))
sw <- geomorphon_sweep(dem, param_grid = grid, forms = "forms10")
ens_mode <- geomorphon_ensemble(sw, method = "modal")
ens_prop <- geomorphon_ensemble(sw, method = "proportions")
} # }