.BG
.VE $Header: /usr3/s/current/s/.help/RCS/hclust,v 1.2 83/12/30 19:28:57 rab Exp $
.FN hclust
.TL
hclust: Hierarchical Clustering
.CS
hclust(dist, method, sim)
.PP
.AG dist
a distance structure or distance matrix.  Normally this will be the
result of the function `dist', but it can be any data of the
form returned by `dist', or a full, symmetric matrix.
.AG method
character string giving the clustering method.  The three
methods currently implemented are "average", "connected"
(single linkage) and "compact" (complete linkage).  The
default is "compact".  (The first three characters of the
method are sufficient.)
.AG sim=
optional structure replacing `dist', but giving similarities
rather than distances. Exactly one of `sim' or `dist' must
be given.
.RT
a "tree" representing the clustering, consisting of the
following components:
.PP
.RC merge
an (`n'\-1) by 2 matrix, if there were `n' objects in the
original data.  Rows 1,2,...,`n'\-1 of `merge' describe the
merging of clusters at steps 1,2,...,`n'\-1 of the clustering.
If an element in the row is of the form `\-j', then object `j'
was merged at this stage.  If the element of `merge' is of
the form `+i', then the merge was with the cluster formed at
the (earlier) stage `i' of the algorithm.
.RC height
the clustering "height"; that is, the distance between
clusters merged at the successive stages.
.RC order
a vector giving a permutation of the original objects
suitable for plotting, in the sense that a cluster plot
using this ordering will not have crossings of the branches.
.SH SEE ALSO
The functions `plcust' and `labclust' are used for plotting
the result of a hierarchical clustering.
Functions `cutree', `clorder', and `subtree' can be used
to manipulate the tree data structure.
.EX
h <- hclust(dist(x))
plclust(h)

hclust(dist(x),"ave")
.KW cluster
.KW multivariate
.KW array*
.KW hierarchical clustering
.WR
