Description Usage Arguments Value Examples
Draws an alternative to the dendrogram using cpcp coordinates. Colors according to a specific number of clusters make the interpretation easier. Also splits which follow each other within a margin of min.gap (proportion of maximum height) can be displayed by boxes.
1 2 |
x |
A hierarchical clustering object. |
k |
The maximum number of clusters to plot. Possible are values up to |
color.id |
The number of clusters for the coloring. |
label |
Whether or not to draw observation labels. Makes sense for small datasets. |
opts |
Graphics and colour parameters such as lwd, ps or alpha. |
min.gap |
Joins which are closer than min.gap from each other will be packed and displayed as a box. |
spline |
Whether or not to use spline curves instead of straight line connections between the points. |
... |
dots |
TRUE
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ## Not run:
library(amap)
hc <- hcluster(USArrests)
# the full plot:
dendro(hc, k = 24, min.gap = 0.00)
# aggregation splits within 0.02 maximum height
dendro(hc, k = 24, min.gap = 0.02)
# the same graphic with spline curves instead of straight lines.
dendro(hc, k = 24, min.gap = 0.02, spline = TRUE)
# olive oil data
sx <- scale(olives[,-c(1,2,11)])
hc <- hcluster(sx)
plot(hc)
dendro(hc, 120, color.id = 6, min.gap=0.005)
dendro(hc, 120, color.id = 6, min.gap=0.1)
dendro(hc, 120, color.id = 6, min.gap=0.1, spline = TRUE)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.