clustconst: Constancy table of a classification

View source: R/clustconst.R

clustconstR Documentation

Constancy table of a classification


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, ...)



Community data, a site by species data frame.


An site-by-group matrix indicating the (hard or fuzzy) membership of each object in x to a set of groups.


An object of class 'clustconst'.


Use mode="all" to print the constancy table, mode="cluster" to print constancy values for one cluster, and mode="species", to print constancy values for one species.


A string with the name of a cluster (in mode="cluster"), or the name of a species (in mode="species").


A flag to indicate whether constancy table should be sorted in descending order.


A threshold used to limit the values shown.


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

See Also

vegclust, kmeans


## Loads stats

## Loads data  
## This equals the chord transformation 
## (see also \code{\link{decostand}} in package 'vegan')
wetland.chord =, 1, 
                              sqrt(rowSums(as.matrix(wetland)^2)), "/"))

## Performs a K-means clustering = kmeans(wetland.chord, centers=3, nstart=10)

## Gets constancy table of KM (i.e. hard) clusters
c=clustconst(wetland.chord, memb=as.memb($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])

vegclust documentation built on Aug. 25, 2022, 9:08 a.m.