I'm trying to create a stacked bar chart, but I've run into an issue where ggplot2 automatically stacks the values in my chart based on magnitude rather than keeping the stack order the same between bars.
Dataset: https://drive.google.com/file/d/1lriQafJRtGrNC6OD2FnHx9Rt-BT9ReVm/view?usp=sharing
Code:
library(viridis)
library(ggplot2)
ggplot(rank_df,
aes(y = Rank, x = Kinase, fill = Database)) +
geom_bar(stat="identity") +
coord_flip() + theme_minimal() +
scale_fill_viridis(discrete = T, option = "turbo")