vegclust (version 2.0.0)

CAP: Cumulative abundance profile (CAP)


Functions to calculate cumulative abundance profiles (CAPs), to build matrices from them, and to summarize several profiles.


CAP(x, transform=NULL, verbose=FALSE)
CAP2matrix(CAP, type="cumulative",classWeights=NULL)
CAPcenters(CAP, y=NULL)
CAPquantile(CAP, q = 0.5, y = NULL)



A stratified vegetation data set (see function stratifyvegdata).


A function or the name of a function to be applied to each cumulative abundance value.


A logical flag to indicate extra output.


An object of class 'CAP'.


The type of information that the resulting matrix should contain. Either "profile", "abundance" or "volume".


A numerical vector containing the weight for size class. If NULL, then all classes are assumed to have the same weight.


A vector used as a factor to calculate average or quantile profiles per each level. Alternatively, an object of class vegclust for which CAP centroids or medoids are desired.


Probability value for which the quantile is desired. By default the median is given.


Function CAP returns an object of class 'CAP', similar to objects of class 'stratifiedvegdata' but where abundance values of upper size classes have beed added to those of lower size classes. Function CAP2matrix returns a matrix with species as rows (columns depend on the value of type). Functions CAPcenters and CAPquantile return an object of class 'CAP'.


Function CAP replaces the abundance value of a size class by the sum of abundances in this and larger size classes (strata). Thus, upper classes contain smaller abundance values than lower classes, creating a cumulative abundance profile. Function CAP2matrix takes an object of class 'CAP' and returns a data matrix, where values differ depending on parameter type: (1) type="cumulative" simply reshapes the 'CAP' object (a list) into a matrix with as many rows as plot records and where columns are organized in blocks (there are as many blocks as species and each block has as many columns as size classes); (2) type="total" returns a plot-by-species matrix where each value is the total abundance of the species in the plot (i.e. the CAP value at the ground level); (3) type="volume" returns a plot-by-species matrix where each value is the sum of CAP values across size classes (a measure of the "volume" occupied by the species in the plot). When provided, classWeights are used to weight size classes of the cumulative abundance profiles (for (1) and (3) only). Function CAPcenters calculates the average abundance profile for a set of plot records. If y is a factor, it is used to speficy groups of samples for which average profiles are to be calculated. If y is an object of class 'vegclust' then the function returns the CAP centroids or medoids corresponding to the clustering result. Function CAPquantile calculates a quantile profile for a set of CAPs. The usage of y is the same as for CAPcenters.


De C<U+00E1>ceres, M., Legendre, P. & He, F. (2013) Dissimilarity measurements and the size structure of ecological communities. Methods in Ecology and Evolution 4: 1167-1177.

De C<U+00E1>ceres, M., Coll, L., Mart<U+00ED>n-Alc<U+00F3>n, S., Gonz<U+00E1>lez-Olabarria, J.R. (submitted) A general method for the classification of forest stands using structure and composition.

See Also

stratifyvegdata, plot.CAP, vegdiststruct


Run this code
## Load stratified data

## Check that 'medreg' has correct class

## Look at the data for the third plot

## Create cumulative abundance profile (CAP) for each plot
medreg.CAP = CAP(medreg)

## Look at the profile of the third plot

## Create matrix with species abundances
medreg.X = CAP2matrix(medreg.CAP, type="total")

## Generate and plot average profile
average.CAP = CAPcenters(medreg.CAP)

## Generate and plot median profile
median.CAP = CAPquantile(medreg.CAP, q = 0.5)

# }

Run the code above in your browser using DataCamp Workspace