Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

set_leaf_colours

Set the leaf colours of a dendrogram


Description

Set the leaf colours of a dendrogram

Usage

set_leaf_colours(d, col, col_to_set = c("edge", "node", "label"))

set_leaf_colors(d, col, col_to_set = c("edge", "node", "label"))

Arguments

d

the dendrogram

col

Single colour or named character vector of colours. When NA no colour will be set.

col_to_set

Character scalar - kind of colour attribute to set

Author(s)

jefferis

See Also

Examples

d5=colour_clusters(hclust(dist(USArrests), "ave"),5)
dred=set_leaf_colours(d5,'red','edge')
stopifnot(isTRUE(all(leaf_colours(dred)=='red')))
d52=set_leaf_colours(d5,leaf_colours(d5),'edge')
stopifnot(all.equal(d5,d52))

dendroextras

Extra Functions to Cut, Label and Colour Dendrogram Clusters

v0.2.3
GPL (>= 2)
Authors
Gregory Jefferis [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.