Target = type-7 percentile p of x within the reference group (default
P95). Gap = max(0, target - x). Production gap = sum(gap x area), so t/ha
becomes tonnes when cell areas are in hectares.
Usage
wapor_calc_productivity_gap(
x,
p = 0.95,
reference = NULL,
id = NULL,
zones = NULL,
zone_id = NULL
)Arguments
- x
Numeric or SpatRaster (for example yield or biomass).
- p
Percentile (default 0.95).
- reference, id
Grouping as in
wapor_classify().- zones, zone_id
Optional polygons to summarise production gap per zone.