Re: [R] error in color-labeling in plot.lm

From: Prof Brian D Ripley <>
Date: Mon 08 May 2006 - 18:33:32 EST

On Mon, 8 May 2006, Ulrich Halekoh wrote:

> I want to label groups of points in
> the plot of residuals against predicted values
> generated by plot.lm().
> Labelling the points by color
> x<-1:15
> y<-rnorm(15)
> f<-factor(rep(c(1:3),each=5))
> g<-glm(y~x)
> plot(g,which=1,col=c(1,2,3)[f])
> I receive the error message
> Error in title(main, sub, xlab, ylab, line, outer, ...) :
> graphical parameter "col" has the wrong length
> How can I resolve the error?

Well, the help does say

      ...: other parameters to be passed through to plotting functions.

and it really is unclear what you intended 'col' to refer to. But as title() is not going to make use of it, it should accept it. I'll see if I can adapt it suitably.

Brian D. Ripley,        
Professor of Applied Statistics,
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________ mailing list
PLEASE do read the posting guide!
Received on Mon May 08 18:47:46 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Mon 08 May 2006 - 20:10:04 EST.

Mailing list information is available at Please read the posting guide before posting to the list.