grid.dendrogram {ComplexHeatmap} | R Documentation |
Draw dendrogram under grid system
grid.dendrogram(dend, facing = c("bottom", "top", "left", "right"), max_height = NULL, order = c("normal", "reverse"), ...)
dend |
a |
facing |
facing of the dendrogram. |
max_height |
maximum height of the dendrogram. It is useful to make dendrograms comparable if you want to plot more than one dendrograms. Height for each dendrogram can be obtained by |
order |
should leaves of dendrogram be put in the normal order (1, ..., n) or reverse order (n, ..., 1)? It may matters for the dendrograms putting on left and right. |
... |
pass to |
The dendrogram can be renderred (e.g. by dendextend
package).
A viewport is created which contains the dendrogram.
This function only plots the dendrogram without adding labels. The leaves of the dendrogram
locates at unit(c(0.5, 1.5, ...(n-0.5))/n, "npc")
.
No value is returned.
Zuguang Gu <z.gu@dkfz.de>
hc = hclust(dist(USArrests[1:5, ])) dend = as.dendrogram(hc) grid.newpage() layout = grid.layout(nrow = 2, ncol = 2) pushViewport(viewport(layout = layout)) grid.dendrogram(dend, layout.pos.row = 1, layout.pos.col = 1) grid.dendrogram(dend, facing = "top", layout.pos.row = 1, layout.pos.col = 2) grid.dendrogram(dend, facing = "top", order = "reverse", layout.pos.row = 2, layout.pos.col = 1) grid.dendrogram(dend, facing = "left", layout.pos.row = 2, layout.pos.col = 2) upViewport()