evoCA {adiv}R Documentation

Evolutionary Correspondence Analysis

Description

The function evoCA performs the evolutionary correspondence analysis (evoCA) (Pavoine 2016): an adaptation of the correspondence analysis (CA) to analyse the distributions of lineages among sites and, simultaneously, to analyse the phylogenetic composition of sites. The function plot.evoCA displays the phylogeny on the factorial maps of evoCA.

Usage

evoCA(phyl, comm, scannf = TRUE, nf = 2, abundance = TRUE)

## S3 method for class 'evoCA'
plot(x, xaxis = 1, yaxis = 2, graph = FALSE, ...)

Arguments

phyl

an object inheriting the class phylo (see package ape), phylo4 (see package phylobase) or hclust. To ease the interpretation of factorial maps, it is advised to use a rooted phylogenetic tree and to add labels to the nodes of the phylogeny. For example, If you phylogeny is named 'tree' and is of class phylo, you can root the phylogeny using tree$root.edge <- 0 and you can name the nodes with the following command: tree$node.label <- paste("n", 1:tree$Nnode, sep=""). Use plot(tree, show.node.label=TRUE) to see the result. If it is rooted and of class phylo4, you can use: nodeLabels(tree) <- paste("n", 1:nNodes(tree), sep="").

comm

a data frame or a matrix typically with communities (or sites, plots, etc.) as rows, species as columns and presence/absence (1/0) or an index of abundance as entries. Species should be labeled as in the phylogenetic tree where they are the tips.

scannf

a logical value indicating whether the screeplot (eigenvalues) should be displayed for choosing the number of axes to be kept.

nf

if scannf is FALSE, an integer indicating the number of axes to be kept.

abundance

a logical value, if FALSE, only the presences/absences of the evolutionary units in sites are considered.

x

an object of class evoCA

xaxis

the number of the evoCA axis chosen for the x-axis of the 3d plot.

yaxis

the number of the evoCA axis chosen for the y-axis of the 3d plot.

graph

a logical value. plot.evoCA depends on package rgl. This package will only work if you have graphics support on your computer. If you do have graphics support, choose graph = TRUE and you will be able to visualize the 3d plot with coordinates for species and phylogenetic nodes.

...

other arguments can be added and passed to the function plot3d of package rgl.

Value

evoCA returns an object of class evoCA and of class dudi (see package ade4, ?dudi). Graphical tools are associated with class dudi in packages ade4 and adegraphics (see example section below and ?scatter.dudi).

The returned object contains the following components:

tab

a data frame with n rows and p columns, with communities as rows and nodes of the phylogeny as columns; the entries of the data frame evaluate the degree of dependence (values that depart from zero)/independence(close-to-zero values) between the occurrence in a community and the position in the phylogeny;

cw

weights attributed to the nodes of the phylogeny, a vector with p components;

lw

weights attributed to the communities, a vector with n components;

eig

vector of eigenvalues;

rank

integer, number of axes;

nf

integer, number of kept axes;

c1

normed scores for the nodes of the phylogeny, data frame with p rows and nf columns;

l1

normed scores for the communities, data frame with n rows and nf columns;

co

scores for the nodes of the phylogeny, data frame with p rows and nf columns;

li

scores for the communities, data frame with n rows and nf columns;

call

the original call.

If X is an object of class evoCA, then attributes(X)$phy contains the phylogenetic tree (of class phylo) with names for internal nodes.

plot.evoCA returns a dynamics 3-dimensional plot

Author(s)

Sandrine Pavoine sandrine.pavoine@mnhn.fr

References

Pavoine, S. (2016) A guide through a family of phylogenetic dissimilarity measures among sites. Oikos, 125, 1719–1732.

See Also

evoNSCA, evopcachord, evopcahellinger, evodiss

Examples

## Not run: 
if(require(ade4) && require(ape) && require(adegraphics)){
O <- adegpar()$plabels$optim
adegpar("plabels.optim" = TRUE)

data(batcomm)
ab <- batcomm$ab
phy <- read.tree(text=batcomm$tre)
plot(phy, show.node=TRUE)
evoCAbat <- evoCA(phy, ab, scan=FALSE, nf=2)
evoCAbat$eig/sum(evoCAbat$eig)
s.label(evoCAbat$li)
s.label(evoCAbat$co)
s.arrow(evoCAbat$co)
inertia.dudi(evoCAbat, row=TRUE)$row.abs
inertia.dudi(evoCAbat, col=TRUE)$col.abs

evoCAbat <- evoCA(phy, ab, scan=FALSE, nf=3) ## All axes are now retained
# The Euclidean (canonical) distances among habitat points on the evoCA space is
dist(evoCAbat$li)
# which is equal to evoDchi2:
evodiss(phy, ab, "chi2")

# Run the following commands only 
# if you have graphics support to use 
# the rgl package on your computer:
plot(evoCAbat, graph = TRUE)
# With argument "graph = TRUE"
# you will be able to vizualize the 3d plot.

# See also,
plot(evoCAbat, xaxis=1, yaxis=3, graph = TRUE)
adegpar("plabels.optim" = O)

}

## End(Not run)

[Package adiv version 2.2.1 Index]