fortify.hclust | R Documentation |
mosaic tools for clustering
## S3 method for class 'hclust'
fortify(
model,
data,
which = c("segments", "heatmap", "leaves", "labels", "data"),
k = 1,
...
)
## S3 method for class 'hclust'
mplot(
object,
data,
colorize = TRUE,
k = 1,
labels = FALSE,
heatmap = 0,
enumerate = "white",
...
)
model |
a model |
data |
a data-like object |
which |
which kind of fortification to compute |
k |
number of clusters |
... |
additional arguments passed on to |
object |
an object of class |
colorize |
whether to show clusters in different colors |
labels |
a logical indicating whether labels should be used to identify leaves of the tree. |
heatmap |
the ratio of size of heatmap to size of dendrogram.
Use |
enumerate |
a color used for numbers within heatmap. Use
|
KidsFeet |> select(-name, -birthmonth) |> rescale() -> KidsFeet2
M <- dist(KidsFeet2)
Cl <- hclust(M)
fortify(Cl, k=5) |> head(3)
fortify(Cl, which="heatmap", data=KidsFeet2) |> head(3)
fortify(Cl, which="data", data=KidsFeet2) |> head(3)
fortify(Cl, which="labels") |> head(3)
mplot(Cl, data=KidsFeet2, k=4, heatmap=2)
mplot(Cl, data=KidsFeet2, k=4, heatmap=0.5, enumerate="transparent")
mplot(Cl, data=KidsFeet2, k=4, heatmap=2, type="triangle")
mplot(Cl, data=KidsFeet2, k=4, heatmap=0, type="triangle")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.