Learn R Programming

dendextend (version 1.18.1)

which_leaf: Which node is a leaf?

Description

Gives a vector as the number of nodes (nnodes), which gives a TRUE when a node is a leaf.

Usage

which_leaf(dend, ...)

Value

A logical vector with the length of nnodes, which gives a TRUE when a node is a leaf.

Arguments

dend

a dendrogram dend

...

ignored.

See Also

noded_with_condition, is.leaf, nnodes

Examples

Run this code
if (FALSE) {

library(dendextend)

# Getting the dend dend
set.seed(23235)
ss <- sample(1:150, 10)
dend <- iris[ss, -5] %>%
  dist() %>%
  hclust() %>%
  as.dendrogram()
dend %>% plot()

which_leaf(dend)
}

Run the code above in your browser using DataLab