Skip to content
Prev 165976 / 398502 Next

Error : unused arguments in pairs()

Hi there,

I am just starting in R and this might be a very basic question.
I applied one on the examples of 
pairs()
to my own data. The examples shows scatter plots on one side of the matrix
and the correlation coefficients on the other which works well. I  then
modified it slightly because I want different colors in the plots. Now i am
getting the error of unused arguments, because the color arguments are not
used when the corellation coefficient is printed. 
I would be very greatful if anyone could help me to get rid of this error.


Here my code:
+ {
+     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 <- paste(prefix, txt, sep="")
+     if(missing(cex.cor)) cex.cor <- 0.8/strwidth(txt)
+     text(0.5, 0.5, txt, cex = cex.cor * r)
+ }
thanks,

Herwig