Skip to contents

Simple alluvial chart

Usage

alluvial(
  df,
  from,
  to,
  value,
  group = NULL,
  alpha = 0.5,
  from_levels = NULL,
  value_title = NULL,
  group_title = NULL,
  title = NULL,
  subtitle = NULL,
  caption = NULL,
  rect_color = cols_reach("white"),
  rect_border_color = cols_reach("main_grey"),
  rect_text_color = cols_reach("main_grey"),
  theme = theme_reach(axis_y = FALSE, legend_position = "none")
)

Arguments

df

A data frame.

from

A character column of upstream stratum.

to

A character column of downstream stratum.

value

A numeric column of values.

group

The grouping column to fill the alluvium with.

alpha

Fill transparency. Default to 0.5.

from_levels

Order by given from levels?

value_title

The value/y scale title. Default to NULL.

group_title

The group title. Default to NULL.

title

Plot title. Default to NULL.

subtitle

Plot subtitle. Default to NULL.

caption

Plot caption. Default to NULL.

rect_color

Stratum rectangles' fill color.

rect_border_color

Stratum rectangles' border color.

rect_text_color

Stratum rectangles' text color.

theme

Whatever theme. Default to theme_reach().

Value

A donut chart to be used parsimoniously