Sum species cover layers into the units LandWeb simulates

landweb_sum_layers(layers, layerMap)

Arguments

layers

SpatRaster of percent cover, one layer per species (named by its LandWeb code).

layerMap

named character vector from landweb_species_units(): each layer to its unit; NA drops the layer.

Value

A SpatRaster with one layer per unit, the sum of its species' layers, named by unit. Cells that are NA in every layer stay NA. Summing these layers is exactly what Biomass_speciesData does when it merges species (it resamples and thresholds each SCANFI layer, then sums them, with no cap or rescaling).