How can we arrange each bars in such a way that stacked box are arranged in an increasing order rather than random order ?
So, that it is easy to visualize !
Similar questions but this data doesnt consider the counts but the values,
Could not figure how to apply them here.
data <- tribble(~type, ~kind, ~percent,
"ABC", "M", 30,
"ABC", "N", 50,
"ABC", "O", 10,
"ABC", "P", 10,
"BCD", "M", 60,
"BCD", "N", 10,
"BCD", "O", 30,
"DEF", "P", 50,
"DEF", "R", 50
)
data %>%
ggplot(aes(x = type, y = percent , fill = kind)) +
geom_col()