I have been looking through alluvial plots in r on Stack Overflow and all of the ones I see are either horizontal or vertical but not circular. Does anyone know if this is possible to do in r? So far the code i've been working on has just led me to a horizontal plot and my goal is to show how all these species are under the same label, but in the horizontal that is not expressed clearly.
Here is some example data:
Sample Species Label
1 L1 Fish Seafood
2 L2 Shark Seafood
3 L3 Fish Seafood
4 L4 Crab Seafood
5 L5 Crab Seafood
6 L6 Shark Seafood
7 L7 Seal Seafood
8 L8 Crab Seafood
9 L9 Fish Seafood
10 L0 Fish Seafood
Code I have been working on:
ggplot(data = Sample.ID,
aes(axis1 = Sample, axis2 = Species, axis3 = Label)) +
scale_x_discrete(limits = c("Sample", "Species", "Label"), expand = c(.2, .05)) +
xlab("Classification") +
geom_alluvium(aes(fill = Species)) +
theme_minimal() +
ggtitle("Sample to Species to Label")
Which gives me a plot like this
I would like a plot that looks like this, so that the thickness of the line emphasizes how many fall under the same label.
If anyone has any tips on how to create a circular plot in ggplot that would be incredibly helpful! Or any tips on how to more clearly express they are all falling under the same category. Thank you!