Description Usage Arguments Details Examples
This is a customized dendrogram plot where images are added to the leaf labels. The function uses functions from the dendextend and stats libraries.
1 2 3 4 5 6 7 8 9 10 |
centers |
The centers. Each row is a center and each column is a variable. |
img.list |
A list of images for each center. Image 1 goes with center row 1, etc. |
type |
The type of distance to use. This will determine how to calculate the distance between the centers. See details. |
scale.same |
All images should be on the same scale |
pal |
The color ramp for the images. This will determine what the images look like. |
lab.extra |
Extra information to add to the labels. |
color.labels |
If TRUE, the labels are blue if below a threshold, black within, and red over. |
color.breaks |
The breaks to use for the color labels. |
The dendrogram needs the distance between centers and there are many ways to measure
this. The default is type="mean"
to use the euclidian distance
stats::dist(centers)
. "mean0"
is
similar but the mean of each center is removed (not the mean across centers,
the mean of individual centers). If "correlation"
, then a correlation matrix is used as a
distance matrix.
Once the distance matrix is calculated, stats::hclust()
is used to create the cluster and stats::as.dendrogram()
is used to create the dendrogram object from that. The images are added below the
dendrogram plot using rasterImage()
.
A dendrogram object is returned.
1 2 3 4 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.