
HeatmapR it a lightweight R package that makes it easy to generate high quality, complex heatmaps with minimal data preprocessing or manual customization. Visit the HeatmapR website to get started https://dillonhammill.github.io/HeatmapR/.
As the dimensionality of datasets continues to increase there is a
need for visualisation tools such as heatmaps to present data in an
easily interpretable way. The construction of complex heatmaps poses a
number of challenges as they are composed multiple graphical elements,
such as a coloured matrix, dendrograms, cluster sub-divisions, axes,
titles and legends. The first base graphics implementation of heatmaps
included heatmap() in the stats package and
heatmap.2() in the gplots. The
packages attempt to solve these graphical challenges by treating each
graphical component as a separate plot element and arranging them using
layout(). This approach can generate complex heatmaps but
it rendered users unable to arrange the heatmap with additional plot
elements. HeatmapR aims to address these layout issues
using solely a base graphics approach.
HeatmapR has a number of benefits over other heatmap packages:
ggplot2 or
plotly.heat_map_save()) to export high
resolution images.HeatmapR can be installed directly from GitHub:
devtools::install_github("DillonHammill/HeatmapR")Creating heatmaps is as easy as loading HeatmapR and
supplying your dataset to the heat_map() function. For
details on customising your heatmaps, refer to the package vignette.
library(HeatmapR)
heat_map(
mtcars,
scale = "column",
scale_method = "range",
tree_x = TRUE,
tree_y = TRUE,
tree_cut_x = 4,
tree_cut_y = 12,
cell_size = TRUE,
cell_shape = "circle",
title = "mtcars"
)
HeatmapR relies on statistical methods in the
stats package to compute distance matrices and perform
hierarchical clustering. HeatmapR also uses some
modified stats code from the ggdendro package to get
the co-ordinates for the dendrogram line segments.
Please note that the HeatmapR project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.
If you use HeatmapR for your work please cite the package as follows:
citation("HeatmapR")
#> To cite package 'HeatmapR' in publications use:
#>
#> Hammill D (2026). _HeatmapR: Create Heatmaps Using Base Graphics_. R
#> package version 1.1.0, <https://dillonhammill.github.io/HeatmapR/>.
#>
#> A BibTeX entry for LaTeX users is
#>
#> @Manual{,
#> title = {HeatmapR: Create Heatmaps Using Base Graphics},
#> author = {Dillon Hammill},
#> year = {2026},
#> note = {R package version 1.1.0},
#> url = {https://dillonhammill.github.io/HeatmapR/},
#> }