| plot.cor {plot.matrix} | R Documentation |
plot.cor
Description
Visualizes a correlation matrix with a colored or gray heatmap. As a rule of thumb the breaks are determined
by the effect sizes given by
Cohen (c(-1, -0.4, -0.2, -0.05, 0, +0.05, +0.2, +0.4, +1).
You may need to modify mar with the par command from its default
c(5.1,4.1,4.1,2.1).
See
-
vignette('plot.matrix')for detailed examples, and -
plot.matrixfor further parameters.
Usage
## S3 method for class 'cor'
plot(x, reorder = TRUE, gray = FALSE, grey = FALSE, ...)
Arguments
x |
matrix: correlation within [-1,+1] |
reorder |
logical: if the rows (variables) of the loading matrix should be reordered (default: |
gray |
logical: should be a gray scale color palette used or not (default: |
grey |
logical: should be a gray scale color palette used or not (default: |
... |
further parameter given to the |
Details
If either the parameter grey or gray is TRUE then a gray color palette is used.
Value
a plot
Examples
par(mar=c(5.1, 4.1, 4.1, 4.1))
# correlation matrix
c <- cor(airquality[,1:4], use="pairwise")
plot(as.cor(c))
plot(as.cor(c), gray=TRUE)
plot(as.cor(c[,1:3]), reorder=FALSE)