Skip to content

Instantly share code, notes, and snippets.

@Ram-N
Last active December 15, 2015 09:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ram-N/5240959 to your computer and use it in GitHub Desktop.
Save Ram-N/5240959 to your computer and use it in GitHub Desktop.
library(ggplot2)
library(reshape2)
data(movies)
movieGenres <- movies[c(18:23)] #subset to 6 genres
cor(movieGenres) # 6x6 cor matrix
#ggplot likes the data 'melted' one value per row
m <-melt(cor(movieGenres))
p <- ggplot(data=m, aes(x=Var1, y=Var2, fill=value)) + geom_tile()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment