Используя dendrapply
, вы можете настроить свой дендро по своему усмотрению.
[/g0]
colLab <- function(n) {
if(is.leaf(n)) {
a <- attributes(n)
attr(n, "label") <- substr(a$label,1,2) # change the node label
attr(n, "nodePar") <- c(a$nodePar, lab.col = 'red') # change the node color
}
n
}
require(graphics)
hc <- hclust(dist(USArrests), "ave")
clusDendro <- as.dendrogram(hc)
clusDendro <- dendrapply(clusDendro, colLab)
op <- par(mar = par("mar") + c(0,0,0,2))
plot(clusDendro,horiz=T)