Module 8: Visual Correlation Analysis




library(ggplot2)
library(reshape2)
mydata <-
mtcars[, c(1,4,6)]
cormat <-
round(cor(mydata),2)

melted_cormat <-
melt(cormat)
ggplot(data = melted_cormat, aes(x=Var1, y=Var2, fill=value)) +
  geom_tile()

Comments