Hi there,

Here is the panel.cor function from ?pairs:
     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 <- abs(cor(x, y))
         txt <- format(c(r, 0.123456789), digits = digits)[1]
         txt <- paste0(prefix, txt)
         if(missing(cex.cor)) cex.cor <- 0.8/strwidth(txt)
         text(0.5, 0.5, txt, cex = cex.cor * r)
     }

in the following code, pairs use the panel.cor defined above:

     pairs(USJudgeRatings, lower.panel = panel.smooth, upper.panel = panel.cor,
           gap=0, row1attop=FALSE)

I try to change prefix = "" to prefix = "r = ", something like:

     pairs(USJudgeRatings, lower.panel = panel.smooth, upper.panel = panel.cor, 
prefix = "r = ",
           gap=0, row1attop=FALSE)

I got lots of warnings.

How to change prefix to something else, but not change the defined panel.cor? 
Thanks!

Best,
Jinsong

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to