[R] pairs() uses col argument for axes coloring

Duncan Murdoch murdoch at stats.uwo.ca
Fri Jul 8 13:51:42 CEST 2005

Olaf Mersmann wrote:
> Hi list,
> not sure if this is the wanted behavior, but running the following code:

I'd say it's a bug.
> platform i386-pc-mingw32
> arch     i386
> os       mingw32
> system   i386, mingw32
> status
> major    2
> minor    1.1
> year     2005
> month    06
> day      20         
> language R
>>n <- 500
>>d <- 4
>>m <- matrix(runif(n*d, -1, 1), ncol=d)
>>c <- hsv(apply(m, 1, function(x) {sum(x*x)/d}), 1, 1)
>>pairs(m, col=c)
> gives me the desired coloring of the points but also colors the axes.
> Looking at the source for pairs() suggests, that this is the case
> because col is part of the ... argument list which is passed on to
> localAxis (and from there to axis). Wouldn't it be more approptiate to
> use the same color box() uses to draw the border around each
> scatterplot? If yes, should I open a bug for this or how would such a
> feature request be handled?

The best way is to get the source to pairs() (from the SVN repository 
in https://svn.r-project.org/R/trunk/src/library/graphics/R/pairs.R not 
from looking at it in R), work out what changes are needed, and submit 
them as a patch.  You can post the patch in the R-bugs list, or just 
send it to me.   Thanks!

Duncan Murdoch

More information about the R-help mailing list