iris = read.csv('iris.csv')
iris
library(ggplot2)
ggplot(iris, aes(x=sepal.length))+
geom_histogram()
`stat_bin()` using `bins = 30`. Pick
better value with `binwidth`.
##Correlation Matrix
#must numeric value
#cor_mat = cor(iris[,c(1,2,3,4)])
cor_mat = cor(iris[,1:4])
cor_mat
sepal.length sepal.width petal.length petal.width
sepal.length 1.0000000 -0.1175698 0.8717538 0.8179411
sepal.width -0.1175698 1.0000000 -0.4284401 -0.3661259
petal.length 0.8717538 -0.4284401 1.0000000 0.9628654
petal.width 0.8179411 -0.3661259 0.9628654 1.0000000
library(ggcorrplot)
ggcorrplot(cor_mat)
ggcorrplot(cor_mat,type='lower',colors =c('red','white','pink'))
ggcorrplot(cor_mat,type='lower',colors =c('green','white','pink'),
lab=TRUE
)