Re: [R] Order of boxplots

2015-09-15 Thread peter dalgaard
> On 15 Sep 2015, at 04:31 , li li wrote: > > Hi Jeff, > Thanks for replying. I actually tried "ordered(tmp$type, levels=c("c", > "b", "a")." > But I think only the order of the letters on x axis changed but the order You _think_ ??? Documentation, please... The

Re: [R] Order of boxplots

2015-09-15 Thread li li
Thank you! That worked. 2015-09-15 2:50 GMT-04:00 peter dalgaard : > > > On 15 Sep 2015, at 04:31 , li li wrote: > > > > Hi Jeff, > > Thanks for replying. I actually tried "ordered(tmp$type, levels=c("c", > > "b", "a")." > > But I think only the order

Re: [R] Order of boxplots

2015-09-14 Thread li li
Hi Jeff, Thanks for replying. I actually tried "ordered(tmp$type, levels=c("c", "b", "a")." But I think only the order of the letters on x axis changed but the order of the boxplot did not. So there is some problem there. I also tried as.factor(tmp$type); levels(tmp$type)=c("c", "b", "a") and

[R] Order of boxplots

2015-09-14 Thread li li
Hi all, I have the following data "tmp" and I want to plot boxplots for each level of the factor "type" and the order the factor should be c, b ,a. In other words, the boxplot corresponding to the level "c" should be the first and so on. Any suggestions? Li > tmp result type 1 101

Re: [R] Order of boxplots

2015-09-14 Thread Jeff Newmiller
Make your factor variable deliberately. That is, specify the levels parameter with the values in order when you create the factor. --- Jeff NewmillerThe . . Go Live...

Re: [R] Order of boxplots

2015-09-14 Thread Kristina Wolf
Have you tried: tmp$type= factor(tmp$type, levels = c("c", "b", "a")) Then try your boxplots. *​~ Kristina* ​​ Kristina Wolf ​ ​ Ph.D. Candidate, Graduate Group in Ecology M.S. Soil Science ​, ​ B.S. Animal Science​ ​ KristinaMWolf.com Restoration Ecology Lab ​ Department of Plant Sciences ​