Maps a cluster back up the tree to the first node where the mapped and correct clusters agree.

lca(dend, l1, l2, l = rep(attr(dend, "label"), length(l1)))

Arguments

dend

a cluster dendrogram

l1

a vector of node labels

l2

a second fector of node labels (of the same length as l1)

l

do not adjust; required for recursive function

Value

The function will return a vector for lowest common ancestor for every pair of nodes in l1 and l2