Skip to content

Instantly share code, notes, and snippets.

@stephenturner
Created February 27, 2015 20:27
Show Gist options
  • Save stephenturner/72908c712041bf41f547 to your computer and use it in GitHub Desktop.
Save stephenturner/72908c712041bf41f547 to your computer and use it in GitHub Desktop.
the dress heatmap
library(NMF)
set.seed(42)
m1 <- matrix(rnorm(20000*5, mean=0), nrow=5)
m2 <- matrix(rnorm(20000*5, mean=1.2), nrow=5)
m <- cbind(t(m1), t(m2))
myiqr <- apply(m, 1, var, na.rm=T)
mostvar <- order(myiqr, decreasing=T)[1:20]
hmat <- m[mostvar, ]
aheatmap(hmat, col=colorRampPalette(c("#806E46", "#968264", "#8794BE", "#838CC3", "#656581"))(100), labRow=NA, labCol=NA, scale="row")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment