corrr icon indicating copy to clipboard operation
corrr copied to clipboard

Using mixed methods to visualize a correlation matrix as in corrplot

Open luifrancgom opened this issue 1 year ago • 0 comments

Feature

I have been using the package corrplot where there is a function corrplot::corrplot.mixed . This function uses mixed methods to visualize a correlation matrix which in the package corrr are not incorporated in relation to corrr::autoplot. Here is a comparison between the plots created:

Libraries and data

library(tidyverse)
library(corrr)
library(corrplot)
#> corrplot 0.92 loaded

iris_numeric <- iris |>
  as_tibble() |>
  select(where(is.numeric))

corrr plot


iris_numeric |>
  correlate() |>
  autoplot()
#> Correlation computed with
#> • Method: 'pearson'
#> • Missing treated using: 'pairwise.complete.obs'

corrplot plot

cor(iris_numeric) |>
corrplot.mixed()

As you can see corrplot::corrplot.mixed includes more information. For example in the lower level of the plot it adds the value of the correlations. I don't know if you will like to add more options to corrr::autoplot that are included in corrplot::corrplot.mixed .

luifrancgom avatar Aug 03 '23 16:08 luifrancgom