In [2]:
# Carregando os pacotes
library(ggplot2)
library(reshape2)
In [3]:
# Definindo o dataset
data <- airquality[,1:4]
In [4]:
# Gerando o gráfico
qplot(x = Var1, y = Var2, data = melt(cor(data, use = "p")), fill = value, geom = "tile") +
scale_fill_gradient2(limits = c(-1, 1))