Last active
August 29, 2015 14:25
-
-
Save ZeccaLehn/0a0f948c9fd1a84a0467 to your computer and use it in GitHub Desktop.
[R] Dendogram heatmaps in R -- both static and D3.js comparisons
This file contains hidden or 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
##### Dendogram Reatmaps in R -- both static and D3.js comparisons ##### | |
library(d3heatmap) | |
# Comperables (w/scaled values -- better than below) | |
heatmap(scale(mtcars), Colv=T) | |
d3heatmap(scale(mtcars), Colv=T, colors="YlOrRd") | |
# Comperables (w/actual values -- not as strong as above) | |
heatmap(as.matrix(mtcars), scale="column", Colv=T) | |
d3heatmap(mtcars, scale = "column", Colv=T, colors="YlOrRd" ) | |
# Refs: | |
# http://digitheadslabnotebook.blogspot.com/2011/06/drawing-heatmaps-in-r.html | |
# https://github.com/rstudio/d3heatmap | |
#Note with d3.js (Rstudio) | |
# "You can also include them in R Markdown chunks, | |
# or use them in Shiny applications with the d3heatmapOutput | |
# and renderD3heatmap functions." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment