This hack will disable the on.exit temporarily:
pairs.data.frame <- function(x, ...) {
on.exit <- function(...) {}
environment(pairs.default) <- environment()
pairs.default(x, ...)
}
pairs(iris)
par("usr")
# add points to lower right square
points(1:10/10, 1:10/10, col = "r
I dug around in pairs, and I think it has something to do with the
on.exit(par(opar)) bit:
f <- function() {
opar <- par(mfrow = c(2, 2), mar = rep(0.5, 4), oma = rep(4, 4))
on.exit(par(opar))
for(i in 1:4) plot(0:1, 0:1)
par(c("mfg", "omd", "fig", "plt", "usr"))
I would look into the code for pairs(). Among other things, it sets and
restores par(mfrow=...). I suspect this is the relevant issue, not the
use of pairs(). I would try to figure out what state a graphics device
is in after resetting par("mfrow"). When I try the following (R 2.6.0
patched
Hi,
I posted over at R-help, and didn't get a response, but perhaps that
was the wrong forum for this question. I'm having some confusion over
the coordinate system after using pairs. I'm not interested in the
content of the actual pairs plot, although the number of pairs seems
to matter a bit.