Learn R Programming

swapClass (version 1.0.1)

nbPerm: Number of swaps that can be performed

Description

The number of permutations is calculated by summing the number of "swappable" sub-matrices per pair of abundance classes. The number of abundance classes needs to be relatively low, the swapClass algorithm being efficient on semi-quantitative multi-classes (or ordinal) variables (e.g. Braun-Blanquet- type abundance/dominance scores) but not on continuous quantitative variables.

Usage

nbPerm(mat)

Arguments

mat

an object of class matrix with abundance classes.

Value

a single numeric value.

Details

nbPerm is the sum of "swappable" sub-matrices divided by the number of cells in the matrix (number of rows x number of columns). nbPerm calls a dynamically defined functions (swapClass_NBP) with in-lined C code compiled by setCMethod on package load.

References

Borgy B. - Dynamic and assembly of weed communities: Approach by statistical modeling (2011). Ph.D. Thesis. INRA Agroicologie & Universiti de Bourgogne. DOI: 10.13140/RG.2.1.1738.1601

See Also

nullModel

Examples

Run this code
MAT=matrix(sample(0:3,50*20,replace=TRUE,prob=c(.7,.1,.1,.1)),ncol=20)
nbPerm(MAT)

Run the code above in your browser using DataLab