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

Olaf Mersmann olaf.mersmann at gmail.com
Fri Jul 8 04:27:54 CEST 2005


Hi list,

not sure if this is the wanted behavior, but running the following code:

> version
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?

-- Olaf Mersmann




More information about the R-help mailing list