Data example from dbv:
gender Sektion
1 m 5
2 m 5
3 w 3B
4 w 3B
5 w 3B
6 m 4
You can add scale_x_discrete
with the limits
argument to do this. You could simply write out the limits in the order you want, but that gets complicated when you have many factor levels. Instead, you can pull the levels of the factor from your dataset and take advantage of rev
to put them in reverse order.
It would look like:
scale_x_discrete(limits = rev(levels(dbv$Sektion)))