I'm having trouble reordering the bars in this bar chart. Here is my code:
ggplot(Issues103, aes(IssueNew)) +
geom_bar(aes(y = (..count..)/sum(..count..))) +
geom_text(aes(y = ((..count..)/sum(..count..)),
label = scales::percent((..count..)/sum(..count..))),
stat = "count", vjust = -0.25, size = 3.2) +
scale_y_continuous(labels=scales::percent) +
theme(axis.text.x = element_text(angle = 90, hjust = 1)) +
labs(title = "Issues Discussed in WIR Speeches: 103rd Congress", x = "Issue", y = "Percentage of WIR Speeches")
This gets me:
I'd like to reorder the bars by percentage in descending order. I've looked everywhere, but I can't figure out how to do this when y = (..count..)/sum(..count..).
I'm very new to all of this, so thanks for the help!