Fence: Colorize tips of 'hclust' plot

View source: R/tcoords.r

FenceR Documentation

Colorize tips of 'hclust' plot

Description

Uses segments() and Tcoords() to colorize 'hclust' plot

Usage

  Fence(hcl, fct, ex=0.05, lwd=2.5, horiz=FALSE, hang=0.1, ...)

Arguments

hcl

hclust object

fct

Variable to colorize labels, will be converted into factor

ex

The fraction of the plot height by which segments go up and down from the tips; by default, it is half of the 'hang'

lwd

Line width of segments

horiz

Plot on a horizontal tree?

hang

The fraction of the plot height by which labels should hang below the rest of the plot; by default, it is equal to the default 'hang' from hclust which is 0.1

...

Further arguments to segments()

See Also

Tcoords, hclust

Examples


iris.h <- hclust(dist(iris[, -5]))
plot(iris.h, labels=FALSE)
Fence(iris.h, iris$Species)
legend("topright", legend=levels(iris$Species), col=1:3, lwd=2.5, bty="n")


shipunov documentation built on Feb. 16, 2023, 9:05 p.m.

Related to Fence in shipunov...