Learn R Programming

BiodiversityR (version 2.7-2)

CAPdiscrim: Canonical Analysis of Principal Coordinates based on Discriminant Analysis

Description

This function provides a method for CAP as described by the authors of the ordination method. The CAP method implemented in vegan through capscale conforms more to distance-based Redundancy Analysis (Legendre & Anderson, 1999) than to the original description for CAP (Anderson & Willis, 2003 ).

Usage

CAPdiscrim(formula, data, dist="bray", axes=4, m=0, permutations=0)

Arguments

formula
Formula with a community data frame (with sites as rows, species as columns and species abundance as cell values) or distance matrix on the left-hand side and a categorical variable on the right-hand side (only the first explanatory variable will be used).
data
Environmental data set.
dist
Method for calculating ecological distance with function vegdist: partial match to "manhattan", "euclidean", "canberra", "bray", "kulczynski", "jaccard", "gower", "morisita", "horn" or "mountford". This argument is ignored in case that the left-hand side of the formula already is a distance matrix.
axes
Number of PCoA axes (cmdscale) to provide in the result.
m
Number of PCoA axes to be investigated by discriminant analysis (lda). If m=0 then the number of axes that provides the best distinction between the groups is calculated (following the method of Anderson and Willis).
permutations
The number of permutations for significance testing.

Value

The function returns an object with information on CAP based on discriminant analysis. The object contains following elements:The object can be plotted with ordiplot, and species scores can be added by add.spec.scores .

Details

This function provides a method of Constrained Analysis of Principal Coordinates (CAP) that conforms to the description of the method by the developers of the method, Anderson and Willis. The method investigates the results of a Principal Coordinates Analysis (function cmdscale) with linear discriminant analysis (lda). Anderson and Willis advocate to use the number of principal coordinate axes that result in the best prediction of group identities of the sites. For permutations > 0, the analysis is repeated by randomising the observations of the environmental data set. The significance is estimated by dividing the number of times the randomisation generated a larger percentage of correct predictions.

References

Legendre, P. & Anderson, M.J. (1999). Distance-based redundancy analysis: testing multispecies responses in multifactorial ecological experiments. Ecological Monographs 69: 1-24.

Anderson, M.J. & Willis, T.J. (2003). Canonical analysis of principal coordinates: a useful method of constrained ordination for ecology. Ecology 84: 511-525.

Kindt, R. & Coe, R. (2005) Tree diversity analysis: A manual and software for common statistical methods for ecological and biodiversity studies. http://www.worldagroforestry.org/output/tree-diversity-analysis

Examples

Run this code
library(vegan)
library(MASS)
data(dune)
data(dune.env)
Ordination.model1 <- CAPdiscrim(dune~Management, data=dune.env,
    dist="bray", axes=2, m=0)
Ordination.model1
plot1 <- ordiplot(Ordination.model1)
ordisymbol(plot1,dune.env,"Management",legend=FALSE)
## CLICK IN THE GRAPH TO INDICATE THE POSITION FOR THE LEGEND
## IN CASE THAT THE OPTION WAS LEGEND=TRUE.

# plot change in classification success against m
plot(seq(1:14), rep(-1000, 14), xlim=c(1, 14), ylim=c(0, 100), xlab="m", 
    ylab="classification success (percent)", type="n")
for (mseq in 1:14) {
    CAPdiscrim.result <- CAPdiscrim(dune~Management, data=dune.env, 
        dist="bray", axes=2, m=mseq)
    points(mseq, CAPdiscrim.result$percent)
}

#

Run the code above in your browser using DataLab