[R] Again, about boxplot

cathelf cathelf at hotmail.com
Fri Sep 12 17:07:38 CEST 2008


Thank you for your guys reply for my previous question. But I got one more
question about the boxplot. With the code in the R-help:

boxplot(len ~ dose, data = ToothGrowth,
        boxwex = 0.25, at = 1:3 - 0.2,
        subset = supp == "VC", col = "yellow",
        main = "Guinea Pigs' Tooth Growth",
        xlab = "Vitamin C dose mg",
        ylab = "tooth length", ylim = c(0, 35), yaxs = "i")
boxplot(len ~ dose, data = ToothGrowth, add = TRUE,
        boxwex = 0.25, at = 1:3 + 0.2,
        subset = supp == "OJ", col = "orange")
legend(2, 9, c("Ascorbic acid", "Orange juice"),
       fill = c("yellow", "orange"))

I got 6 boxplots, which is ordered as "0.5, 0.5, 1, 1, 2, 2"
How can I reorder the 6 boxplots as "0.5, 1, 2,  0.5, 1, 2"?

Thank you very much!
-- 
View this message in context: http://www.nabble.com/Again%2C-about-boxplot-tp19457862p19457862.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list