mosaic (version 0.14.4)

fortify.hclust: mosaic tools for clustering

Description

mosaic tools for clustering

Usage

# S3 method for hclust
fortify(model, data, which = c("segments", "heatmap",
  "leaves", "labels", "data"), k = 1, ...)

# S3 method for hclust mplot(object, data, colorize = TRUE, k = 1, labels = FALSE, heatmap = 0, enumerate = "white", ...)

Arguments

model

a model

data

a data-like object

which

which kind of fortification to compute

k

number of clusters

...

additional arguments passed on to link{dendro_data}

object

an object of class "hclust"

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 0 or FALSE to omit the heatmap.

enumerate

a color used for numbers within heatmap. Use "transparent" to hide.

Examples

Run this code
# NOT RUN {
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")
# }

Run the code above in your browser using DataCamp Workspace