I have the below code:
library(ggplot2)
theme_set(theme_classic())
g <- ggplot(EYAnmut_3rdParty, aes(QuestionNumber))
g + geom_bar(aes(fill=stemmed), width = 0.5) +
theme(axis.text.x = element_text(angle=65, vjust=0.6)) +
labs(title="Histogram Plot")
Which provides this plot:
How can I sort the Questions in the Y-axis to be in ascending order (smallest to largest) ? At the moment, it looks very scrambled.
The structure of my dataframe looks like this:
I tried changing the structure of my QuestionNumber variable to factor but it doesn't work.