# vegdist

##### Good Dissimilarity Measures for Ecological Gradients

The function computes community dissimilarity indices which are known to have a good rank-order relation with gradient separation and are thus efficient in community ordination with multidimensional scaling.

- Keywords
- multivariate

##### Usage

`vegdist(x, method="bray", diag=FALSE, upper=FALSE)`

##### Arguments

- x
- Community data matrix
- method
- Dissimilarity index
- diag
- Compute diagonals.
- upper
- Return only the upper diagonal.

##### Details

The function knows the following dissimilarity indices:
`euclidean`

$d_{jk} = \sqrt{\sum_i (x_{ij}-x_{ik})^2}$
`manhattan`

$d_{jk} = \sum_i |x_{ij} - x{ik}|$
`gower`

$d_{jk} = \sum_i \frac{|x_{ij}-x_{ik}|}{\max_i-\min_i}$
`canberra`

$d_{jk}=\frac{1}{N-Z} \sum_i
\frac{|x_{ij}-x{ik}|}{x_{ij}+x_{ik}}$
`bray`

$\frac{\sum_i |x_{ij}-x{ik}|}{\sum_i (x_{ij}+x_{ik})}$
`kulczynski`

$d_{jk} = 1-0.5(\frac{\sum_i \min(x_{ij},x_{ik})}{\sum_i x_{ij}} +
\frac{\sum_i \min(x_{ij},x_{ik})}{\sum_i x_{ik}} )$
}
where $N-Z$ is the number of non-zero entries.

Infamous ``double zeros'' are removed in Canberra dissimilarity.

Euclidean and Manhattan dissimilarities are not good in gradient
separation without proper standardization but are still included for
comparison and special needs.

Some of indices become identical or rank-order similar after some
standardizations.

##### Value

- Should be interchangeable with
`dist`

and return a distance object of the same type.

##### Note

The function is an alternative to `dist`

adding
some ecologically meaningful indices. Both methods should produce
similar types of objects which can be interchanged in any method
accepting either. Manhattan and Euclidean dissimilarities should be
identical in both methods, and Canberra dissimilary may be similar.

##### References

Faith, D.P, Minchin, P.R. and Belbin, L. (1987)
Compositional dissimilarity as a robust measure of ecological
distance. *Vegetatio* 69, 57-68.

##### See Also

##### Examples

```
data(varespec)
vare.dist <- vegdist(varespec)
```

*Documentation reproduced from package vegan, version 1.0-1, License: GPL2*