Description Usage Arguments Value Note Author(s) See Also Examples

View source: R/clustcentroid.R

Function `clustcentroid`

calculates the centroid (multivariate average) coordinates of a classification. Function `clustmedoid`

determines the medoid (object whose average dissimilarity to all the other objects is minimal) for each cluster in the classification.

1 2 | ```
clustcentroid(x, y, m = 1)
clustmedoid(x, y, m = 1)
``` |

`x` |
Community data, a site-by-species data frame. In function |

`y` |
It can be (a) A vector indicating the cluster that each object in |

`m` |
Fuzziness exponent, only effective when |

Function `clustcentroid`

returns a group-by-species matrix containing species average abundance values (i.e. the coordinates of each cluster centroid). Function `clustmedoid`

returns a vector of indices (medoids).

In order to assign new plot record data into a predefined set of classes, one should use functions `as.vegclust`

and `vegclass`

instead.

Miquel De Cáceres, Forest Science Center of Catalonia

`as.vegclust`

, `vegclass`

, `vegclust`

, `kmeans`

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ```
## Loads stats
library(stats)
## Loads data
data(wetland)
## This equals the chord transformation
## (see also \code{\link{decostand}} in package 'vegan')
wetland.chord = as.data.frame(sweep(as.matrix(wetland), 1,
sqrt(rowSums(as.matrix(wetland)^2)), "/"))
## Performs a K-means clustering
wetland.km = kmeans(wetland.chord, centers=3, nstart=10)
## Gets the coordinates corresponding to the centroids of KM clusters
clustcentroid(wetland.chord, y=wetland.km$cluster)
## Gets the object indices corresponding to the medoids of KM clusters
clustmedoid(wetland.chord, y=wetland.km$cluster)
``` |

vegclust documentation built on May 29, 2018, 9:04 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.