Learn R Programming

⚠️There's a newer version (0.12.6) of this package.Take me there.

ggalluvial

Design

This is a ggplot2 extension for alluvial diagrams. The alluvial plots implemented here can be used to visualize frequency distributions over time or frequency tables involving several categorical variables. The design is derived mostly from the alluvial package, but the ggplot2 framework induced several conspicuous differences:

  • alluvial understands a variety of inputs (vectors, lists, data frames), while ggalluvial requires a single data frame;
  • alluvial uses each variable of these inputs as a dimension of the data, whereas ggalluvial requires the user to specify the dimensions, either as separate aesthetics or as key-value pairs;
  • alluvial produces both the alluvia, which link cohorts across multiple dimensions, and (what are here called) the strata, which partition the data along each dimension, in a single function; whereas ggalluvial relies on separate layers (stats and geoms) to produce strata, alluvia, and alluvial segments called lodes and flows.

Issues and pull requests are more than welcome.

Usage

The latest stable release can be installed from CRAN:

install.packages("ggalluvial")

Development versions can be installed from GitHub:

devtools::install_github("corybrunson/ggalluvial", build_vignettes = TRUE)

For detailed discussion of the data formats recognized by ggalluvial and several examples that illustrate its flexibility and limitations, read the vignette:

vignette(topic = "ggalluvial", package = "ggalluvial")

Copy Link

Version

Install

install.packages('ggalluvial')

Monthly Downloads

41,551

Version

0.5.0

License

GPL-2

Maintainer

Jason Cory Brunson

Last Published

November 26th, 2017

Functions in ggalluvial (0.5.0)

majors

Student curricula across semesters
is_alluvial

Check a data frame for alluvial structure
geom_alluvium

Alluvia across strata
ggalluvial-deprecated

Deprecated functions
geom_flow

Flows between lodes or strata
geom_lode

Lodes at intersections of alluvia and strata
GeomAlluvium

Base ggproto classes for ggalluvial
lode-guidance-functions

Lode guidance functions
stat_flow

Flow positions
vaccinations

Influenza vaccination rates
stat_stratum

Stratum positions
stat_alluvium

Alluvial positions
geom_stratum

Strata at axes
to_alluvia

Expand an axis indicator and an axis value into multiple axis variables
to_lodes

Combine multiple axis variables into an axis indicator and an axis value