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 |
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 |
abundance |
a logical value, if |
x |
an object of class |
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. |
... |
other arguments can be added and passed to the function |
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)