.BG
.FN dist
.TL
Distance Matrix Calculation
.CS
dist(x, metric="euclidean")
.AG x
matrix (typically a data matrix).  The distances computed
will be among the rows of `x'.  Missing values (`NA's) are
allowed.
.AG metric
character string specifying the distance metric to be used.
The currently available options are "euclidean",
"maximum", "manhattan", and "binary".
Euclidean distances are root sum-of-squares of differences,
maximum is the maximum difference, manhattan is the sum
of absolute differences, and binary is the proportion
of nonzeroes that two vectors have in common.
.RT
the distances among
the rows of `x'.  Since there are many distances
and since the result of `dist' is typically an argument to
`hclust', a vector is returned, rather than a symmetric matrix.
The returned object has an attribute,
.Co size ,
giving
the number of objects (that is, rows of `x').
.PP
Missing values in a row of `x' are not included in any distances
involving that row.  Such distances are then inflated to account for
the missing values.  If all values for a particular distance are
excluded by this rule, the distance is `NA'.
.EX
dist(x,"max") # distances among rows by maximum
dist(t(x)) # distances among cols in euclidean metric
.KW array
.KW multivariate
.KW cluster
.WR
