[R] ordering boxplots according to median

Jacques VESLOT jacques.veslot at cirad.fr
Wed Mar 22 10:21:23 CET 2006


boxplot(count~spray, InsectSprays)
spray2 <- with(InsectSprays, factor(spray, 
levels=levels(spray)[order(tapply(count,spray,median))]))
boxplot(count~spray2, InsectSprays)


Talloen, Willem [PRDBE] a écrit :

>Dear R-users,
>
>Does anyone knows how I can order my serie of boxplots from lowest to
>highest median (which is much better for visualization purposes).
>
>thanks in advance,
>willem
>
>	[[alternative HTML version deleted]]
>
>______________________________________________
>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
>
>  
>




More information about the R-help mailing list