Extract Part of a Cluster Tree

DESCRIPTION:

Returns a cluster tree which is the smallest subtree of the original that contains all of the specified leaves.

USAGE:

subtree(tree, leaves) 

REQUIRED ARGUMENTS:

tree
a cluster tree object, normally the result of a call to hclust.
leaves
vector of objects (i.e., row numbers of the original data matrix) which should be included in the extracted subtree.

VALUE:

the smallest subtree of tree which includes all the leaves ; i.e., a list which includes the components merge, height and order described under hclust. It can be used in the various summaries of cluster results, such as plclust .

SEE ALSO:

, , , .

EXAMPLES:

votes.clust <- hclust(dist(votes.repub), "ave") 
# subtree including 1st and 10th objects 
subtree(votes.clust, c(1,10)) 
mv.vote <- subtree(votes.clust, match(c("Maryland", 
                   "West Virginia", "Virginia"), state.name)) 
plclust(mv.vote, labels = state.abb)