Skip to contents

Takes 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().

Usage

transition_data(label_df, times)

Arguments

label_df

tibble or data.frame with columns scenario, replicate, Time, row, column, label – as returned by leading_species() or community_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 path

  • x – year (from times)

  • stratum – vegetation type label at that year

  • y – 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.