The following code, modified from the R help page for pairs(), works in
R, but in the s-plus Enterprise Developer Version 7.0.6 for Microsoft
Windows, I get the error message that follows it. How can I get these
same effects in s-plus? (The effects are pairs plots with lowess curves
in the lower triangle, and numerical correlation coefficients in the
upper triangle.)
Here's the code:
panel.cor <- function(x, y, digits=2, prefix="", cex.cor)
{
usr <- par("usr"); on.exit(par(usr))
par(usr = c(0, 1, 0, 1))
r <- (cor(x, y)) # abs
txt <- format(c(r, 0.123456789), digits=digits)[1]
txt <- paste(prefix, txt, sep="")
if(missing(cex.cor)) cex <- 0.95/strwidth(txt)
text(0.5, 0.5, txt) #, cex = cex * r)
}
pairs(the.data, lower.panel=panel.smooth, upper.panel=panel.cor)
and here is the error message:
Problem in pairs.data.frame(for.pairs, lower.panel = panel.smooth,
upp..: Can't pass data of mode "function" to old-S function
Thanks for any help you can provide
David Parkhurst
|