Explore correlations with bar charts

Author

Francisco Zambrano

Published

July 1, 2023

Installation

Development version from GitHub:

GitHub: https://github.com/zpio/ggexplorer

Show/Hide code
remotes::install_github("zpio/ggexplorer")
Show/Hide code
library(ggexplorer)

Examples

Mtcars dataset

Show/Hide code
library(dplyr)
mtcars <- mtcars %>% mutate(dplyr::across(c(am, carb, cyl, gear, vs), as.factor))
mtcars

Basic Chart

Show/Hide code
plotCorrelate(mtcars)

Method

Show/Hide code
plotCorrelate(mtcars, method = "kendall")

Width

Show/Hide code
plotCorrelate(mtcars, width = 0.5)

Colors

Show/Hide code
plotCorrelate(mtcars, palette_gradient = 'Orange-Blue Diverging')

See Details for available palettes (ordered-diverging):

https://jrnold.github.io/ggthemes/reference/tableau_color_pal.html

Interactive

Show/Hide code
plotCorrelate(mtcars, interactive = TRUE, label_show = FALSE,
              palette_gradient = 'Green-Blue-White Diverging')