[R] ordered boxplots

Jacques Veslot jacques.veslot at good.ibl.fr
Thu Apr 27 10:49:08 CEST 2006


boxplot(count ~ spray, data = InsectSprays, col = "lightgray", 
at=with(InsectSprays, rank(tapply(count, spray, median))))

Chuck Cleland a écrit :
> ?reorder.factor shows the follwing example:
> 
> bymedian <- with(InsectSprays, reorder(spray, count, median))
> 
> boxplot(count ~ bymedian, data = InsectSprays,
>          xlab = "Type of spray", ylab = "Insect count",
>          main = "InsectSprays data", varwidth = TRUE,
>          col = "lightgray")
> 
> Thomas Hoffmann wrote:
> 
>>Dear List-Members,
>>
>>I would like to produce a ordered boxplot in which the categories with 
>>the smallest median are plotted at the left end and the box with the 
>>largest median at the right.
>>
>>Thanks in advance for any advices
>>Thomas H.
>>
>>______________________________________________
>>R-help at stat.math.ethz.ch mailing list
>>https://stat.ethz.ch/mailman/listinfo/r-help
>>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>>
> 
> 


-- 
-------------------------------------------------------------------
Jacques.Veslot at good.ibl.fr
CNRS UMR 8090 - http://www-good.ibl.fr
Génomique et physiologie moléculaire des maladies métaboliques
I.B.L 2eme etage - 1 rue du Pr Calmette, B.P.245, 59019 Lille Cedex
Tel : 33 (0)3.20.87.10.44 Fax : 33 (0)3.20.87.10.31




More information about the R-help mailing list