panel.cor: Display correlation coefficients in a scatterplot matrix.

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/panel_functions.R

Description

Displays the absolute value of the Pearson correlation coefficient between pairs of variables in a scatterplot matrix. The size of the test depends on the size of the coefficient. The background colour depends on the p-value for the test of the null hypothesis of zero correlation:
orange < 0.001 < gold < 0.01 < yellow < 0.05 < pale yellow < 0.1 < white
For large data sets, all coefficients may be significant.

Usage

1
panel.cor(x, y, digits = 2, prefix = "", cex.cor, ...)

Arguments

x,y

Two variables for which the correlation is required.

digits

Number of digits to display.

prefix

Text to display in front of the value.

cex.cor

Size of the characters displayed. By default this is proportional to the value of the correlation coefficient.

...

further graphical parameters.

Details

Implement by setting panel arguments when calling the scatterplot function: see examples. Note that providing values for digits, prefix or cex.cor causes pairs to produce many warnings that these are not graphical parameters.

Value

None.

Author(s)

Mike Meredith, 2012-08-29, based on code from the pairs help file.

See Also

pairs

Examples

1
2
3
4
5
6
7
require(graphics)
data(trees)

pairs(trees, panel=panel.cor)

pairs(trees, lower.panel=panel.cor, prefix="|r|=")
  # Produces 36 warnings.

mikemeredith/MMmisc documentation built on Nov. 8, 2019, 11:34 p.m.