# Cumulative abundance surface (CAS)

### Description

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

### Usage

1 2 3 4 5 |

### Arguments

`x` |
An object of class 'doublestratifiedvegdata' (see function |

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

`verbose` |
A logical flag to indicate extra output. |

`CAS` |
An object of class ' |

`margin` |
Indicates whether marginalization should be done in primary ( |

`type` |
The type of information that the resulting matrix should contain (either |

`classWeights` |
A numerical matrix containing the weight for each combination of size classes. If |

`y` |
A vector used as a factor to calculate average or quantile surfaces per each level. Alternatively, an object of class |

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

### Details

Function `CAS`

replaces the abundance value of each combination of size classes by the sum of abundances in this and larger size classes. This creates a cumulative abundance surface (similar to a bivariant cummulative distribution function). Function `CASmargin`

takes an object of class '`CAS`

' and returns an object of class '`CAP`

' that corresponds marginal profile in either the primary or the secondary size classes. Function `CAS2matrix`

takes an object of class '`CAS`

' and returns a data matrix, where values differ depending on parameter `type`

: (1) `type="cummulative"`

simply reshapes the '`CAS`

' 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 combinations of 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 CAS value at the ground level). When provided, `classWeights`

are used to weight size classes of the cumulative abundance surfaces (for (1) only). Function `CAScenters`

calculates the average abundance surface 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 CAS centroids or medoids corresponding to the clustering result. Function `CASquantile`

calculates a quantile surface for a set of CASs. The usage of `y`

is the same as for `CAScenters`

.

### Value

Function `CAS`

returns an object of class '`CAS`

', similar to objects of class '`doublestratifiedvegdata`

' but where abundance values of upper size classes have beed added to those of lower size classes. Function `CAS2matrix`

returns a matrix with species as rows (columns depend on the value of `type`

). Functions `CAScenters`

and `CASquantile`

return an object of class '`CAS`

'.

### Author(s)

Miquel De Cáceres, Forest Science Center of Catalonia.

### References

De Cá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áceres, M., Coll, L., Martín-Alcón, S., González-Olabarria, J.R. (submitted) A general method for the classification of forest stands using structure and composition.

### See Also

`stratifyvegdata`

, `plot.CAS`

, `vegdiststruct`

### Examples

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | ```
## Load tree data
data(treedata)
## Define stratum thresholds (4 strata)
heights = seq(0,4, by=0.5)
diameters = seq(0,2, by=0.5)
## Stratify tree data using heights and diameters as structural variables
X = stratifyvegdata(treedata, sizes1=heights, sizes2=diameters, plotColumn="plotID",
speciesColumn="species", size1Column="height", size2Column="diam",
counts=TRUE)
X[[2]]
## Build cummulative abundance surface
Y = CAS(X)
Y[[2]]
## Extracts the first and second marginal (i.e. CAP on heights or diameters respectively)
Y.M1 = CASmargin(Y, margin = 1)
Y.M1[[2]]
Y.M2 = CASmargin(Y, margin = 2)
Y.M2[[2]]
## For comparison we calculate the same profiles using the stratifyvegdata and CAP functions
Y1 = CAP(stratifyvegdata(treedata, sizes1=heights, plotColumn="plotID",
speciesColumn="species", size1Column="height",
counts=TRUE))
Y1[[2]]
Y2 = CAP(stratifyvegdata(treedata, sizes1=diameters, plotColumn="plotID",
speciesColumn="species", size1Column="diam",
counts=TRUE))
Y2[[2]]
## Compare Y.M1[[2]] with Y1[[2]] and Y.M2[[2]] with Y2[[2]]
``` |