I am using the attached data below to produce boxplot. Datalink https://www.dropbox.com/s/dt1nxnkhq90nea4/GTAP_Sims.csv
So far, I have this code that I am using:
# Distribution of EV for all regions under the BASE scenario
evBASE.f <- subset(ccwelfrsts, tradlib =="BASE")
p <- ggplot(data = evBASE.f, aes(factor(region), ev))
p + geom_boxplot() +
theme(axis.text.x = element_text(colour = 'black', angle = 90, size = 16)) +
theme(axis.text.y = element_text(colour = 'black', size = 16))
it reproduces a plot that looks: Plot file:///C:/Users/iouraich/Documents/ggplot_Results.htm
What I am looking for here is to have the x-axis in the plot match the order of the header "region" in the csv file.
Is there any option within ggplot that allows to control for that?
Thanks a lot
See Question&Answers more detail:os