Plot categorical timeseries as alluvial diagram
plot_categorical.RdUses ggalluvial::geom_flow() and geom_stratum() to show how patients
transition between categorical response levels across timepoints. Falls
back to bar charts if the alluvial plot fails.
Matches applytsoa's report_plot_measure_val_cat() + report_plot_cat_alluvial().
Arguments
- param_ids
Character vector of one-hot encoded
parameter_idvalues for this categorical field.- df_measures
Data frame as returned by
prepare_measures().- thresh
Numeric, score threshold for flagging.
- sites
Character vector of site IDs to show. If NULL, auto-selected.
- visit_order
Character vector of visit labels in desired x-axis order, or NULL for default (timepoint_rank) ordering.