Learn R Programming

adiv (version 1.2)

evoCA: 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 evoCA plot(x, xaxis = 1, yaxis = 2, …)

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 add labels to the nodes of the phylogeny. For example, If your phylogeny is named 'tree' and is of class phylo, you can name the nodes with the following command: tree$node.label <- paste("n", 1:tree$Nnode, sep=""). If it is of class phylo4, you can use: nodeLabels(tree) <- paste("n", 1:nNodes(tree), sep=""). Use plot(tree) to see the result.

comm

a data frame or a matrix typically with communities (or sites, plots, etc.) as rows, species as columns and presence/absence 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

other parameters 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 object returned 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 n components

lw

weights attributed to the communities, a vector with p components

eig

eigenvalues, a vector with min(n,p) components

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

References

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

See Also

See Also evoNSCA, evopcachord, evopcahellinger, evodiss

Examples

Run this code
# NOT RUN {
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")

plot(evoCAbat)

plot(evoCAbat, xaxis=1, yaxis=3)
# }

Run the code above in your browser using DataLab