
Build a transition data frame for alluvial plots
transition_data.RdTakes per-cell type labels (from leading_species() or community_label()),
pivots to wide form, counts unique label-path combinations across all snapshots,
and converts to the lodes (long) form required by ggalluvial::geom_alluvium().
Arguments
- label_df
tibbleordata.framewith columnsscenario, replicate, Time, row, column, label– as returned byleading_species()orcommunity_label().- times
Integer vector of snapshot years to include, in order. All values must be present in
label_df$Time.
Value
A tibble in lodes form with columns
alluvium, x, stratum, y
compatible with ggalluvial::geom_alluvium():
alluvium– integer ID for the flow pathx– year (fromtimes)stratum– vegetation type label at that yeary– mean number of cells (averaged across replicates) following this path
Details
Counts are averaged across replicates so that the diagram represents the mean landscape behaviour.
See also
Other Vegetation transition helpers:
biomass_landscape_summary(),
community_label(),
leading_species(),
plot_species_biomass(),
plot_transitions(),
read_biomass_c_snapshots(),
read_biomass_output_rasters()