[R] Order of boxs in box plots

David Doyle kydaviddoyle at gmail.com
Tue Oct 28 02:10:01 CET 2014


Hello,

I'm doing some box plots to look at the distributions of groundwater
results. It is plotting the well in the order of their IDs.  ie. MW1B then
MW3B then MW4A.....

 I would like to plot the wells in the order they are at the site such as MW1B
then WES-14-4-93 then ........  Is there a way I can control that??

My data and code are below.

Thank you for your time
David Doyle


MS <- read.table("http://www.doylesdartden.com/R/MS.csv", header=TRUE,
sep=",",)
MSAmmoniax <- c("Well", "AMMONIA")
MSAmmonia <- MS[MSAmmoniax]

plot(MSAmmonia, notch=TRUE, ylab = "Ammonia (mg/L)", cex =
1,col=(c("green","White","White","white","white","green")))
legend("topleft", inset=.002, title="Gradient",
       c("Up","Down"), fill=terrain.colors(2), horiz=TRUE, cex = 0.7,)
title(main="Lower Mudstone Ammonia Box Plots")

	[[alternative HTML version deleted]]



More information about the R-help mailing list