Created
March 5, 2014 02:49
-
-
Save py/9360245 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adaptation of http://martinsbioblogg.wordpress.com/2014/03/03/using-r-correlation-heatmap-take-2/ with labels | |
data <- airquality[,1:4] | |
library(ggplot2) | |
library(reshape2) | |
qplot(x=Var1, y=Var2, data=melt(cor(data, use="p")), fill=value, geom="tile") + | |
scale_fill_gradient2(limits=c(-1, 1)) + | |
geom_text(aes(label=round(melt(cor(data, use="p"))$value,2))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment