Take a data frame with several designated variables to be used as axes in an alluvial diagram, and reshape the data frame so that the axis variable names constitute a new factor variable and their values comprise another. Other variables' values will be repeated, and a row-grouping variable can be introduced. This function invokes gather.

to_lodes(data, key = "x", value = "stratum", id = "alluvium", axes)

Arguments

data

Data frame.

key, value, id

Character; names given to the axis (variable), stratum (value), and alluvium (identifying) variables.

axes

Numeric or character vector; which variables to use as axes.