What about:

y<-rnorm(100);z<-sample(1:7,100,T);boxplot(y~z);points(y~z)

Peter Wolf

Ted Harding wrote:

Hi folks,

I have a vaiable Y and an associated factor Z at several (13)
levels.

 boxplot(Y~Z)

produces a nice array of boxplots, one for each level of Z,
and each duly labaelled with its level of Z.

I would like to superpose on each boxplot the actual data
points which it represents, i.e. do something conceptually
(though not in real R) expressed as

 points(Y~Z)

or

 points(Z,Y)

It can be done "with bare hands" along the lines of

 B<-boxplot(Y~Z)
 x<-bxp(B)
 X<-rep(x,ngroups)
 points(X,Y)

where ngroups is the number of data at each level of Z,
*provided* the data are pre-sorted by level of Z and in the
same order as these levels occurr in the boxplot. But of course
they're not!

OK, I could do this by hand as well, but now it's getting a bit
tedious, and I'm wondering if there's a better way.

Thanks for any suggestions,
Ted.


-------------------------------------------------------------------- E-Mail: (Ted Harding) <[EMAIL PROTECTED]> Fax-to-email: +44 (0)870 167 1972 Date: 04-May-04 Time: 15:48:23 ------------------------------ XFMail ------------------------------

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html



______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to