[R] boxplot grouped by two variables.

Vadik Kutsyy vadik at kutsyy.com
Tue Nov 21 19:26:29 CET 2000


>> Is there a quick way to make boxplots groups by two variables?  By that 
>> I mean, that if x axes have values ("A","B","C"), than at each value 
>> there would be a few boxplots each for a value of second variable (say 
>> ("1","2","3")).
> 
> 
> If I understand you correctly you want to try the "interaction" function
> in a boxplot.  Your data needs to be organised into a data.frame with
> appropriate factors.  Here's a simple example ...
> 
> data(warpbreaks)
> boxplot(breaks~interaction(wool, tension), data=warpbreaks, col=2:3)
> 
> Hope this helps, Jonathan.

Thanks, it works.  Now fowlup question, I created addition level, in 
order to have extra space between groups.  Is there a nicer way to do it?

Thanks.

-- 
Vadim Kutsyy
http://www.kutsyy.com                     vadim at kutsyy.com
The University of Michigan - Ann Arbor         PhD Student

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list