A correlation matrix is used to investigate the dependence between multiple variables at the same time. The result is a table containing the correlation coefficients between each variable and the others. Plotting the correlation matrix helps us understand the relationship among different variables, and often provides us with good information about feature/variable selection or about eliminating redundant features before doing further data analysis.
Plotting a correlations matrix
Getting ready
If you have not already done so, download the book's files for this chapter and save the mtcars.csv file in your R working directory. Read the data into R using the following command and also check the packages needed:
> library...