clustconst | R Documentation |
Allows studying the constancy table (i.e. the frequency of species in each class) of a classification represented in the form of a membership data matrix.
clustconst(x, memb)
## S3 method for class 'clustconst'
summary(object, mode="all", name=NULL, sort=TRUE, minconst=0.5, digits=3, ...)
x |
Community data, a site by species data frame. |
memb |
An site-by-group matrix indicating the (hard or fuzzy) membership of each object in |
object |
An object of class 'clustconst'. |
mode |
Use |
name |
A string with the name of a cluster (in |
sort |
A flag to indicate whether constancy table should be sorted in descending order. |
minconst |
A threshold used to limit the values shown. |
digits |
The number of digits for rounding. |
... |
Additional parameters for summary (actually not used). |
The constancy value of a species in a vegetation unit is the relative frequency of occurrence of the species in plot records that belong to the unit. In case of a fuzzy vegetation unit the constancy value is the sum of memberships of sites that contain the species divided by the sum of memberships of all sites. Use the 'summary' function to obtain information about: (1) which species are more frequent on a given vegetation unit; (2) which vegetation units have higher frequencies of a given target species. Additionally, the 'summary' function can sort a constancy table if mode="all"
and sort=TRUE
are indicated.
Function clustconst
returns an object of type 'clustconst', in fact a data frame with the constancy value of each species (rows) on each cluster (column).
Miquel De Cáceres, CREAF
vegclust
, kmeans
## 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 constancy table of KM (i.e. hard) clusters
c=clustconst(wetland.chord, memb=as.memb(wetland.km$cluster))
## Prints constancy values ordered and store the result in d
d=summary(c, mode="all")
## Prints the most frequent species in the first cluster
summary(c, mode="cluster", name=names(c)[1])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.