.BG
.FN cutree
.TL
Create Groups from Hierarchical Clustering
.CS
cutree(tree, k, h)
.AG tree
hierarchical clustering tree structure, typically the output
of `hclust'.
.AG k
optional, the desired number of groups.
.AG h
optional, the height at which to cut `tree' in order to
produce the groups.  Groups will be defined by the structure
of the tree above the cut.
.PP
Exactly one of `k' or `h' must be supplied.
.RT
vector with as many elements as there are leaves
in the tree.  The ith element of the vector gives the
group number that individual i is assigned to.  Individuals
not in the current tree (if `tree' was a subtree from a
larger original problem) are assigned group 0.
Attribute `height' is a
vector with as many values as there are resulting groups,
the ith value gives the height of the last merge making
up the group. Singleton clusters are given height 0.
.EX
cutree(tr<-hclust(dist),k=5)      #produce 5 groups
.KW multivariate
.KW cluster
.KW array
.WR
