5.7 Numeric vs. numeric: Correlograms

5.7.1 Data & Packages & functions

  • Data: Several numeric variables
  • Correlogram: Visualizes correlations between continuous variables present in the same dataframe
  • Package: ggcorrplot (github)

5.7.2 Graph

  • Figure 5.12 visualizes a correlation matrix for the dataframe mtcars
    • Keep in mind that this works for numeric variables
mpg cyl disp hp drat wt
mpg 1.0 -0.9 -0.8 -0.8 0.7 -0.9
cyl -0.9 1.0 0.9 0.8 -0.7 0.8
disp -0.8 0.9 1.0 0.8 -0.7 0.9
hp -0.8 0.8 0.8 1.0 -0.4 0.7
drat 0.7 -0.7 -0.7 -0.4 1.0 -0.7
wt -0.9 0.8 0.9 0.7 -0.7 1.0
Correlation plot

Figure 5.12: Correlation plot