corrplot R Package

repository·master·Indexed 43 days ago

https://github.com/taiyun/corrplot

An R package providing visual exploratory tools for correlation matrices. It features automatic variable reordering to detect hidden patterns and offers customization for layouts, colors, and statistical significance using p-values and confidence intervals.

Tokens
319
Snippets
3
Records
3
Agent score
6%

What's inside corrplot

  1. Install the corrplot package

    master

    You can install the stable release of corrplot from CRAN using the standard R install.packages command. If you need the development version with vignettes built, use devtools::install_github pointing to the taiyun/corrplot repository.

    # Install the release version from CRAN
    install.packages('corrplot')
    
    # Install the development version from GitHub
    devtools::install_github('taiyun/corrplot', build_vignettes = TRUE)
  2. Create a basic correlation plot

    master

    To visualize a correlation matrix, use the corrplot() function. You can pass a correlation matrix (calculated via cor()) and use arguments like order to reorder variables (e.g., 'hclust' for hierarchical clustering) and addrect to add rectangles around groups of variables to highlight patterns.

    library(corrplot)
    M = cor(mtcars)
    corrplot(M, order = 'hclust', addrect = 2)