
Shares of raster classes within M (e.g. Koppen-Geiger climates)
Source:R/m_output.R
m_class_shares.RdPercentage of the land area of the automatic and the final M in each class of a categorical raster, such as the CHELSA Koppen-Geiger map. Useful to describe M and to see what expert additions or alternative scenarios change.
Arguments
- m
An
m_areaobject.- raster
Categorical raster (classes as integers).
- labels
Optional class labels, indexed by class value (e.g.
koppen_geiger_labels()).- fact
Aggregation factor (modal) to speed up large rasters.
Examples
sim <- simulate_enm_data(seed = 1, n_presence = 150)
m <- delimit_m(sim$presence, link_km = 120, thin_km = 5)
# two classes (1 = west, 2 = east) from a continuous layer
cls <- terra::classify(sim$env[["env1"]],
rbind(c(-Inf, 0.5, 1), c(0.5, Inf, 2)))
m_class_shares(m, cls, labels = c("west", "east"))
#> class label pct_automatic pct_M
#> 1 1 west 47.16 47.16
#> 2 2 east 52.84 52.84