R draw heatmap with clusters, but hide dendrogram
library(gplots)
heatmap.2(mtscaled,dendrogram='none', Rowv=TRUE, Colv=TRUE,trace='none')
Rowv
-is TRUE, which implies dendrogram is computed and reordered based on row means.
Colv
- columns should be treated identically to the rows.
You can do this with pheatmap:
mtscaled <- as.matrix(scale(mtcars))
pheatmap::pheatmap(mtscaled, treeheight_row = 0, treeheight_col = 0)
See pheatmap output here: