ggalluvial: Layered Grammar for Alluvial Plots

J Open Source Softw. 2020;5(49):2017. doi: 10.21105/joss.02017. Epub 2020 May 21.

Abstract

Alluvial diagrams use stacked bar plots and variable-width ribbons to represent multi-dimensional or repeated-measures data comprising categorical or ordinal variables (Bojanowski & Edwards, 2016; Rosvall & Bergstrom, 2010). The ggalluvial package extends the layered grammar of graphics of ggplot2 (Wickham, 2016) to generate alluvial diagrams from tidy data (Wickham, 2014). The package makes two key contributions to the R ecosystem. First, ggalluvial anchors the imprecise notion of an alluvial diagram to the rigid grammar of graphics (Wilkinson, 2006), which lends the plots more precise meaning and opens up many combinatorial possibilities. Second, ggalluvial adopts a distinctive geological nomenclature to distinguish "alluvial plots" and their graphical elements from Sankey diagrams and parallel sets plots, which I hope prove useful as these visualization tools converge toward common standards.