Learn R Programming

shipunov (version 1.11)

Ploth: Changes the appearance of cluster dendrogram

Description

Modifies several aspects of the cluster dendrogram

Usage

Ploth(hclust, labels=hclust[["labels"]], lab.font=1, lab.col=1, col=1,
 pch.cex=1, pch=NA, bg=0, col.edges=FALSE, hang=-1, ...)

Arguments

hclust

Hclust object

labels

Labels

lab.font

Label font

lab.col

Label colors

col

Colors

pch.cex

Scale of points

pch

Point types

bg

Points backgrounds

col.edges

Colorize edges?

hang

Makes leaves hang, see plot.hclust(); -1 is default here whereas 0.1 is default for 'hclust'

...

Further arguments to plot.dendrogram()

Details

Changes the appearance of cluster dendrogram. If labels are long, you might need to modify the plot margins. Please take into account that labels are meant to be in their initial order, not in order of their appearance on the dendrogram.

Examples

Run this code
# NOT RUN {
iris.dist <- dist(iris[, 1:4], method="manhattan")
iris.hclust <- hclust(iris.dist)
Ploth(iris.hclust, col=as.numeric(iris[, 5]), pch=16, col.edges=TRUE, horiz=TRUE,
 leaflab="none")
legend("topleft", fill=1:nlevels(iris[, 5]), legend=levels(iris[, 5]))

Ploth(hclust(UScitiesD, "ward.D2"), labels=abbreviate(attr(UScitiesD, "Labels")),
 lab.col=c(1, rep(2, 9)), lab.font=c(2, rep(1, 9)), hang=0.1)

# }

Run the code above in your browser using DataLab