Description Usage Arguments Details Value Author(s) Examples
Draw dendrogram under grid system
1 2 |
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>
1 2 3 4 5 6 7 8 9 10 11 12 | 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()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.