bmrm (version 4.1)

hclust_fca: Find first common ancestor of 2 nodes in an hclust object

Description

Find first common ancestor of 2 nodes in an hclust object

Usage

hclust_fca(hc, a, b)

Arguments

hc

an hclust object

a

an integer vector with the first leaf node

b

an integer vector with the second leaf node (same length as a)

Value

an integer vector of the same length as a and b identifing the first common ancestors of a and b

Examples

Run this code
# NOT RUN {
  hc <- hclust(dist(USArrests), "complete")
  plot(hc)
  A <- outer(seq_along(hc$order),seq_along(hc$order),hclust_fca,hc=hc)
  H <- array(hc$height[A],dim(A))
  image(H[hc$order,hc$order])
  image(A[hc$order,hc$order])
# }

Run the code above in your browser using DataLab