
Summarise habitat conversion from MapBiomas class areas
Source:R/conversion.R
summarise_conversion.RdAggregates a table of per-class areas into conservation groups and computes the percentage of converted (anthropic) versus remaining natural habitat.
Usage
summarise_conversion(
class_areas,
collection = 10,
initiative = "brazil",
water_in_denominator = FALSE
)Arguments
- class_areas
Either a
data.framewith columnscodeandarea_km2(e.g. frommb_class_areas_gee) or a terraSpatRasterof MapBiomas codes (which is tabulated viamb_class_areas_raster).- collection
Integer collection number (default
10).- initiative
One of
"brazil"(default),"amazonia"or"colombia"; selects the standardised legend context (seemb_legend).- water_in_denominator
Logical; if
TRUE, water is treated as natural and included in the terrestrial denominator (defaultFALSE).
Value
A list with: converted_pct, natural_pct (terrestrial,
the headline numbers), converted_pct_total, natural_pct_total,
the group areas (natural_km2, anthropic_km2, water_km2,
other_km2, not_observed_km2, total_km2) and
by_class (the per-class table joined to the legend).
Details
The headline metrics use a terrestrial denominator (natural + anthropic), excluding water, not-observed and ambiguous "other" classes, which is the most defensible measure of habitat conversion. A total-area version (denominator = everything except not-observed) is also returned for transparency.
Examples
ca <- data.frame(code = c(3, 15, 24, 33), area_km2 = c(60, 30, 10, 5))
summarise_conversion(ca)$converted_pct
#> [1] 40