
Plot year-on-year (non-cumulative) drivers of the change in territorial N losses
Source:R/decomposition_analysis.R
plot_loss_decomp_yearly.RdUses the same data as plot_loss_decomp(), but plots each
year's own additive contribution directly, without accumulating it
over time: each bar shows how much a compartment or mechanism
contributed to the change in territorial N losses in that one
year-on-year transition, not the running total since 1860.
Arguments
- decomp
A named list from
decompose_terr_losses(). IfNULL, computed automatically (slow).
Examples
decomp <- list(
by_compartment = tibble::tribble(
~t0, ~compartment, ~contribution_mgn, ~cumulative_mgn,
1861, "cropland", 12000, 12000,
1862, "cropland", 8000, 20000,
1861, "urban", 500, 500,
1862, "urban", 700, 1200
),
by_mechanism = tibble::tribble(
~t0, ~mechanism, ~contribution_mgn, ~cumulative_mgn,
1861, "Size", 9000, 9000,
1862, "Size", 5000, 14000,
1861, "Intensification", 3500, 3500,
1862, "Intensification", 3700, 7200
)
)
plots <- plot_loss_decomp_yearly(decomp)