[R] boxplot in subgroups

Pooja Jain pcxpj1 at nottingham.ac.uk
Wed Mar 25 23:26:51 CET 2009


Hi,

I have data that looks like this:

ASA1    ASA2    C1_C2
C       M       9.0225
S       S       2.4315
M       C       3.4894
M       S       4.5282
C       M       1.3183
C       S       1.3735
S       C       1.0488
S       M       7.948
M       C       4.5827

I need to plot Boxplots for a given ASA1 (either C,S, or M) with  
respect to C1_C2. However, instead of one boxplot I want to plot three  
boxplots for a given ASA1 value such that each sub-boxplot represent  
the distribution for C1-C2 for each of the three possible values of  
ASA2 (C,S or M). I want to show this subgroup with a single xtics  
(either C, S or M) corresponding to the ASA1 value selected.

I tried to do it, but ending with the following error. I am not sure  
how exactly I should build the object to plot as subgroup.


Error in axis(side = 1, at = 1:9, labels = c("C", "M", "S" :
   'at' and 'labels' lengths differ, 9 != 3
In addition: Warning message:
In bxp(list(stats = c(1e-04, 2.82745, 6.0193, 10.5957, 22.2476,  :
   some notches went outside hinges ('box'): maybe set notch=FALSE


I would greatly appreciate any help in this matter.

Thank you.


-Kanu

This message has been checked for viruses but the contents of an attachment
may still contain software viruses, which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.




More information about the R-help mailing list