Take a data frame with axis and axis value variables to be used in an alluvial diagram, and reshape the data frame so that the axes constitute separate variables whose values are given by the value variable. This function invokes spread_.

to_alluvia(data, key, value, id)

Arguments

data

Data frame.

key, value, id

Numeric or character; the fields corresponding to the axis (variable), stratum (value), and alluvium (identifying) variables.