plot.formula and pch= (PR#149)
Thu, 25 Mar 1999 21:22:49 +0100

I'm not sure exactly where to point my finger with this one, but there
is a nasty surprise to the unsuspecting user.

There is no check on the length of the vector passed in the pch=
argument to plot, it is just recycled as necessary:


gives alternating circles and triangles. 

The nasty bits come up especially with plot.formula:


- and the plotting symbols are *not* all the same. Even more
  pernicious, if missing values are involved:

> y[x%%2==1]<-NA
> plot(y~x,pch=x%%2)

gives you the wrong symbols (in practice, this messes up things like 
plot(height~age,pch=sex) rather badly!).

It would help to get a warning that the lengths don't match, but are
there any good uses of the recycling of pch?

   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (             FAX: (+45) 35327907

r-devel mailing list -- Read
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: