A heatmap is a graphical representation of data where the individual values contained in a matrix are represented as colors. This page displays many examples built with R, both static and interactive.
heatmap()
functionThe heatmap()
function is natively provided in R. It produces high quality matrix and offers statistical tools to normalize input data, run clustering algorithm and visualize the result with dendrograms. It is one of the very rare case where I prefer base R to ggplot2
.
geom_tile()
from ggplot2
ggplot2
also allows to build heatmaps thanks to geom_tile()
. However, I personally prefer the heatmap()
function above since only it offers option for normalization, clustering and Dendrogram.
Heatmaps can be a very good alternative to visualize time series, especially when the time frame you study is repeating, like weeks. Here is a customized example, but visit the time series section for more.
Code Time series sectionlevelplot()
function of lattice