panel.cor | R Documentation |
panel.cor is a panel function modified from that described in the help file for the pairs function from the graphics package. This has been customized both to show that one can make such customizations, and to enable this one to be used to calculate the correlations between the variables included in a pairs plot.
panel.cor(x, y, digits = 3, ...)
x |
the first variable - provided by pairs |
y |
the second variable, provided by pairs, see examples |
digits |
how many digits to use on the pairs plot for the correlations |
... |
any other graphics parameters to be passed to pairs. |
this prints the correlations in a square of the pairs plot
dat <- matrix(rnorm(900,mean=5,sd=0.5),nrow=300,ncol=3)
pairs(dat[,1:3],lower.panel=panel.smooth, # all should be
upper.panel=panel.cor,gap=0.25,lwd=2) #low correlations
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.