Skip to contents

This function prepares a data frame for creating a Sankey plot with multiple transitions. The Sankey plot represents the flow from one set of values to another, where the width of the flow is proportional to its quantity.

Usage

prepare_sankey(df, col_order, value_col)

Arguments

df

The data frame containing the data.

col_order

A vector of column names in the order of the transitions.

value_col

The name of the column to use as the values of the links.

Value

A list containing two data frames: 'nodes' and 'links'.

Author

Dony Indiarto