I am trying to create a barplot using ggplot. The barplot is coming fine but the bars are in lexicographical order which don't make sense. A sample data frame is The age column is as follows
Levels: 0-4 10 11 12 13 14 15 16 17 18 19 20-24 25-29 30-34 35-59 5 6 60+ 7 8 9 Age not stated All ages
And when I plot with ggplot(m2,aes(x=reorder(age),y=value,fill=variable)) + geom_bar(stat = "identity")
I get the plot below
The Age on x axis is lexicographically ordered. So 5,6,7,8,9 are on right of 10,11 etc.
How can this be fixed?