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")). Thank You. -- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Hello, you can make a new variable with the values A1, A2, A3, B1, B2 ... and then do a boxplot and define you own axis-labels. I guess it is not the most elegant way ... Hope it helps jan On Tue, 21 Nov 2000, Vadik Kutsyy wrote:> 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")).+----------------------------------- Jan Goebel (mailto:jgoebel at diw.de) DIW Berlin Longitudinal Data and Microanalysis K?nigin-Luise-Str. 5 D-14195 Berlin -- Germany -- phone: 49 30 89789-377 +----------------------------------- -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Hi Vadik, On Tue, 21 Nov 2000, Vadik Kutsyy wrote:> 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. Jonathan Rougier Science Laboratories Department of Mathematical Sciences South Road University of Durham Durham DH1 3LE http://www.maths.dur.ac.uk/stats/people/jcr/jcr.html -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Jens Oehlschlägel
2000-Nov-23 10:59 UTC
[Rd] RE: [R] boxplot grouped by two variables: general issue
> On Tue, 21 Nov 2000, Vadik Kutsyy wrote: > > > 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 ...I'd rather prefer to have something like coplot(breaks | wool * tension, data = warpbreaks, panel=function(x, y, ...)boxplot(x)) but there are three problems: 1) coplot doesn't seem to support univariate panel functions 2) coplot doesn't seem to support synchronization options for xlim= and ylim= across panels 3) plot functions appear to be EITHER panel functions OR high level plot functions. Needing two versions for each plot function is a little bit complicated. Rather have ONLY panel functions and a one-panel high level wrapper. Here are my questions: a) Any plans to implement trellis? b) Are there any other solutions in R which offer simple trellis functionality? c) Do you think, attacking these problems leads to reinventing trellis with all it's complexity? If the answers turn out to be c(a=NO,b=NO,c=NO) I would like to ask in more detail: Is it possible to write plot functions to properly behave as high level AND as panel functions? Are there any issues that NEED to be addressed beyond 1) to 3) ? Any recommendations? Any related work in progress? Any volunteers? If nobody else is attacking this, I will think about a solution (r-devel: AFTER the strwidth() issue has been resolved) Jens -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel 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-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._