Create interactive heat maps that are usable from the R console, in the 'RStudio' viewer pane, in 'R Markdown' documents, and in 'Shiny' apps. Hover the mouse pointer over a cell to show details, drag a rectangle to zoom, and click row/column labels to highlight.
If you are using a version of d3heatmap older than 0.4.0, please upgrade now! Previous versions put row and column names in the incorrect order!
This is an R package that implements a heatmap htmlwidget. It has the following features:
base::heatmap
http://rpubs.com/jcheng/mtcars-heatmap
To install:
if (!require("devtools")) install.packages("devtools")devtools::install_github("rstudio/d3heatmap")
Like any htmlwidget, you can visualize a d3 heatmap directly from the R console:
library(d3heatmap)d3heatmap(mtcars, scale = "column", colors = "Spectral")
You can also include them in R Markdown chunks, or use them in Shiny applications with the d3heatmapOutput
and renderD3heatmap
functions.
See ?d3heatmap
for options.
d3heatmap - gains new parameters:
Fix error in coloring code; accept palette integers
Remove invert_colors param, it no longer works
Remove heatmap_options parameter, it isn't needed
When scale is not "none" and colors param is not a function, scale colors to be centered at zero
dendToTree - now cleans NA inside the nodePar/edgePar sub items in the list.
d3heatmap - gains new parameters from stats::heatmap and gplots::heatmap.2 - including the ability to input the dendrogram that will be plotted. (currently it supports branches with colors, line width, and line type)
Added a basic Vignette
CRITICAL BUGFIX: The row and column labels were not ordered correctly in previous versions of d3heatmap--ouch! Thank you Sang Hoon Yi!
The vertical order of row data has been flipped, it now matches the output of stats::heatmap.
d3heatmap no longer depends on the leaflet package. It now depends on scales version 2.5 or later.