A graphical display of a correlation matrix or general matrix. It also contains some algorithms to do matrix reordering. In addition, corrplot is good at details, including choosing color, text labels, color labels, layout, etc.
The R package corrplot is for visualizing correlation matrices and confidence intervals. It also contains some algorithms to do matrix reordering. For examples, see its vignette.
This package is licensed under GPL, and available on CRAN: http://cran.r-project.org/package=corrplot.
library(corrplot)M <- cor(mtcars)corrplot(M, order = "hclust", addrect = 2)
To download the development version of the package, type the following at the R command line:
install.packages("devtools")devtools::install_github("taiyun/corrplot", build_vignettes = TRUE)
To download the release version of the package on CRAN, type the following at the R command line:
If you encounter a clear bug, please file a minimal reproducible example on github.
lintr which also performs the analysis on Travis-CI.
lintr is in
Lints are treated as warnings, but we strive to be lint-free.
In RStudio, you can run
lintr from the console as follows:
This package is free and open source software, licensed under GPL.
CHANGES IN corrplot VERSION 0.81
Fixed #79: added parameter
win.asp to control aspect ratio
Fixed #18: parameter
outline combined with
the color of the otline circle of each pie.
CHANGES IN corrplot VERSION 0.80
Fixed #70: Enable to plot a matrix with NA when 'is.corr = F'
CHANGES IN corrplot VERSION 0.77
Fixed #58: make sure the margin is correct in corrplot.mixed().
CHANGES IN corrplot VERSION 0.76
In corrplot(), added parameters na.label and na.label.col that define how NA values inside a matrix should be rendered.
In corrplot(), na.label can now use one or two characters, default is "?" (issue #55)
Fixed #17: restore par() settings on exit (thanks, #yihui)
Fixed #16: checks for [-1, 1] interval are too strict.
Fixed #15: error with correlation plot using insig argument when all values are significant.
Fixed #9: added ward.D and ward.D2 hclust methods (thanks, #jeffzemla)
CHANGES IN corrplot VERSION 0.70
In corrplot(), parameter insig add a option "p-value", now p-values can be conveniently added on the glyph.
Return value changes, corrplot() now returns a reordered correlation matrix.
CHANGES IN corrplot VERSION 0.66
Add html vignette, which was generated from markdown file by knitr.
In corrplot(), remove parameter "zoom", add "is.corr"; now it is more convenient to visualize non-correlation matrix. Parameter "addtextlabel" was renamed as "tl.pos", and "addcolorlabel" was renamed as "cl.pos".
CHANGES IN corrplot VERSION 0.60
Function corr.rect() was renamed as corrRect().
Revise document. (THANKS, Tao Gao)
In function corrplot(), "order"'s choice "PCA" was precisely renamed as "AOE". and "FPC" was added for the first principal component order.
Add function corrMatOrder(), and corrplot.mixed().
Remove seldom used functions: corrplot.circle(), corrplot.ellipse(), corrplot.square(), corrplot.shade(), corrplot.color(), corrplot.number().
In corrplot(), remove parameter "assign.col" and "cl.range", add "zoom", "cl.lim" and "addCoefasPercent".
CHANGES IN corrplot VERSION 0.54