I am trying to reorder the bars (which each represent a categorical variable) in my R ggplot2 Note: I am not trying to reorder the percentages of variables represented within the bars.
This is what my bar chart looks like:
Most importantly, I want Enrollment on the top. Ideally, I would like this in reverse order (then Expulsion, then ISS, then OSS >1 day, then OSS 1 day)
Here is my code:
ggplot(discbyracelong,
aes(x=discipline,
y=pct, fill=Race))+
geom_bar(stat="identity")+
geom_text(aes(label=paste(round(pct,digits= 1),sep="")),
position=position_stack(vjust=0.5),
size= 3)+
coord_flip()+
guides(fill = guide_legend(reverse=TRUE))
Here is a link to my data: https://drive.google.com/file/d/14AwBBZfevTeZyrgwMpz7XwTj8J8pCUgO/view?usp=sharing
Thank you for any help!