dat <- data.frame(
Group = c("A", "A", "B", "B", "C"),
Type = c("X", "Y", "X", "Y", "X")
)
long <- make_long(dat, Group, Type)
ggplot2::ggplot(
long,
ggplot2::aes(
x = x,
next_x = next_x,
node = node,
next_node = next_node,
fill = node
)
) +
geom_sankey() +
theme_sankey()
Run the code above in your browser using DataLab