This question already has an answer here:
- Order Bars in ggplot2 bar graph 12 answers
I'm trying to visualize the different backgrunds of our students, the bars represent different high school programs. I write:
ggplot(test, aes(x=fct_infreq(gymnasiegrov))) + geom_bar()
And I get:
As you can see the names get very cluttered, so I write:
ggplot(test, aes(x=fct_infreq(gymnasiegrov))) + geom_bar()+coord_flip()
And get:
This "does" look much better, but for optimal effect I would like to show the frequencies in descending order from the top, like my first plot but rotated clockwise.
Is there any way I can make this happen?