install.packages("corrplot")
library(corrplot) # load the corrplot package
corplot(corr = cor(mtcars))
# You cannot just put the mtcars into it as a default parameter.
# All the variables into this function should be numeric. (cannot with species column)
corrplot(corr = cor(iris[ , 1:4]))
corrplot(corr = cor(iris[-5])) # Means excluding the 5th column.
corrplot(corr = cor(iris[1:4])) # Select the columns.
# It's always helpful to use the queation mark.
?corrplot
# Or you can use:
help(corrplot)
# In the helping section you can see how to use different parameters in the function.
# And learning by imitating the examples.
And we can see how to use some of the parameters below: