[R] ordered boxplots

Chuck Cleland ccleland at optonline.net
Thu Apr 27 10:44:59 CEST 2006


?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
> 

-- 
Chuck Cleland, Ph.D.
NDRI, Inc.
71 West 23rd Street, 8th floor
New York, NY 10010
tel: (212) 845-4495 (Tu, Th)
tel: (732) 512-0171 (M, W, F)
fax: (917) 438-0894




More information about the R-help mailing list