[Rd] Small change to plot.xy

Deepayan Sarkar deepayan@stat.wisc.edu
Sat, 23 Nov 2002 06:11:07 -0600

On Saturday 23 November 2002 04:53 am, Jonathan Rougier wrote:

> > Does SPSS actually do this, that is arbitrarily assign colours to
> > categories that might be names of colours?
> I think you know the answer to that!  That wasn't my point.  I give
> statistical computing practicals using the same material to two similar
> groups of students, some using SPSS and some using R.  Right now, the
> SPSS students are getting a lot more experience of data analysis.  My
> SPSS students put Species in the "colour points by" box.  You and I may
> disagree on what is natural and what is peverse, but my R students want
> to do "col = iris$Species" and I am sympathetic.

This sort of thing is handled more systematically in Trellis. For example, try

xyplot(Sepal.Length ~ Sepal.Width, data = iris, groups = Species)
splom(iris[, 1:4], groups = iris$Species)

(This doesn't exactly answer your original question, but I think it does 
address the example you have given here.)