Correlation Plot

Let’s start visualizing correlation values in a plot.Open your RStudio and begin typing in !!!

Let's import the library corrplot for correlation matrix visualization


Let's store the dataset mtcars into dataframe named DataFrame

DataFrame <- mtcars

Let's find the correlation matrix of this data set

corrMatrix <- cor(DataFrame)

Let'c visualize the correlation matrix.This plot will tell about the correlation between the feature variables in the data set.
Dark red means correlation=-1
Dark blue means correlation=1
White means correlation=0

corrplot(corrMatrix, method="circle")
Correlation plot

If you want to see the exact correlation value in the plot .Then run the following code

corrplot(corrMatrix, method="number")

correlation values
Correlation values