rlqESLTP {adiv}R Documentation

Linking Patterns in Phylogeny, Traits, Abiotic Variables and Space

Description

An extention of the RLQ approach to identify potential environmental filters in species' traits in a phylogenetic and spatial context.

Usage

rlqESLTP(dudiE, dudiS, dudiL, dudiT, dudiP, ...)

## S3 method for class 'rlqESLTP'
plot(x, which = NULL, phyl = NULL, 
    xy = NULL, traits = NULL, env = NULL, type = NULL, 
    ax = 1, disp = c("dots", "bars", "grid"), ...)

## S3 method for class 'rlqESLTP'
summary(object, ...)

Arguments

dudiE

an object of class dudi of package ade4 (e.g. a principal component applied to environmental variables or a principal coordinate analysis applied to environmental distances between plots). Plots must be weighted as in dudiL. dudiE can be set to NULL if dudiS is not.

dudiS

an object of class dudi of package ade4 (e.g. an eigenvector decomposition applied to a spatial neighbourhood matrix (see Pavoine et al. 2011 for exemples)). Plots must be weighted as in dudiL. dudiS can be set to NULL if dudiE is not.

dudiL

an object of class dudi obtained with function dudi.coa of ade4 applied to a plot (rows) by species (columns) data frame. dudiL cannot be set to NULL.

dudiT

an object of class dudi of package ade4 (e.g. a principal component analysis applied to functional traits of species or a principal coordinate analysis applied to functional distances between species). Species must be weighted as in dudiL. dudiT can be set to NULL if dudiP is not.

dudiP

an object of class dudi of package ade4 (e.g. a principal coordinate analysis applied to phylogenetic distances between species). Species must be weighted as in dudiL. dudiP can be set to NULL if dudiT is not.

x

an object of class rlqESTP (obtained with function rqlESTP).

object

an object of class rlqESTP (obtained with function rqlESTP).

which

a character that might be "E" (in that case arguments env and type must be given); "S" (in that case argument xy must be given); "T" (in that case arguments traits and type must be given); or "P" (in that case argument phyl must be given).

phyl

an object inheriting the class phylo (see package ape), phylo4 (see package phylobase) or hclust.

xy

a data frame with two columns giving the coordinates of the plots (longitude, latitude in that order).

traits

a list of data frames for the traits, each data frame contains variables from a single statistical type (see argument type below). NAs are allowed. However, in that case, the calculations depend, for each trait, on the subset of available data only.

env

a list of data frames for the environmental variables, each data frame contains variables from a single statistical type (see argument type below). NAs are allowed. However, in that case, the calculations depend, for each variable, on the subset of available data only.

type

a vector that provides the type of each table to be analysed in env (if environemental variables should be displayed) or traits (if the focus is on species' traits). The possible types are "Q" (quantitative, numeric), "O" (ordinal), "N" (nominal), "D" (dichotomous), "F" (fuzzy, or expressed as a proportion), "B" (multichoice nominal variables, coded by binary columns), "C" (circular). Values in type must be in the same order as in env or traits.

ax

a numeric indicating the axis of interest.

disp

a string indicating which method to use to display species scores in front of the phylogeny: one of "dots" (for a dot plot), "bars" (for a barplot), and "grid" (for a gridplot for vizualizing scores by a color gradient).

...

further arguments passed to or from other methods.

Value

Function rlqESLTP returns an object of classes rlqESLTP, rlq and dudi. It is a list of 26 objects:

tab

a data frame. Crossed Table (CT): crossing the columns of the merged trait and phylogenetic table with those of the merged environmental and spatial table.

cw

a vector of numerics. Weights attributed to the columns of the merged trait and phylogenetic table.

lw

a vector of numerics. weights attributed to the columns of the merged environmental and spatial table.

eig

a vector of numerics. The vector of eigenvalues.

rank

an integer. The total number of axes in the analysis.

nf

a numeric. The number of axes kept.

c1

a data frame. Principal axes. Normed scores for the columns of merged trait and phylogenetic table.

co

a data frame. Scores for the columns of merged trait and phylogenetic table.

l1

a data frame. Principal axes. Normed scores for the columns of merged environmental and spatial table.

li

a data frame. Scores for the columns of merged environmental and spatial table.

call

call

lQ

data frame. Scores for the species.

mQ

data frame. Normed scores for the species.

lR

data frame. Scores of the plots.

mR

data frame. Normed scores for the plots.

aQ

data frame. Correlations trait/phylogeny axes / coinertia axes.

aR

data frame. Correlations environment/space axes / coinertia axes.

lR_givenE

data frame. Contributions of environmental information to plot scores.

lR_givenS

data frame. Contributions of spatial information to plot scores.

lQ_givenT

data frame. Contributions of trait information to species scores.

lQ_givenP

data frame. Contributions of phylogenetic information to species scores.

row.w

a vector. Weights attributed to plots.

col.w

a vector. Weights attributed to species.

dudiL

object of class dudi (dudiL).

dudiR

object of class dudi (merging information on environment and space).

dudiQ

object of class dudi (merging information on traits and phylogeny).

Author(s)

Sandrine Pavoine sandrine.pavoine@mnhn.fr

References

Pavoine, S., Vela, E., Gachet, S., de Belair, G., Bonsall, M.B. (2011) Linking patterns in phylogeny, traits, abiotic variables and space: a novel approach to linking environmental filtering and plant community assembly. Journal of Ecology, 99, 165–175.

Examples

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

data(mafragh, package="ade4")
xy <- mafragh$xy
#The object that defines the neighbourhood between plots is in
mneig <- mafragh$neig
#mneig is an object of class neig
s.label(mafragh$xy, nb = mafragh$nb, paxes.draw = FALSE)

#The environmental variables are in
env <- mafragh$env
names(env)
#The abundance data are in
flo <- mafragh$flo
# Adjustement of the writing of species names
names <- gsub(" ", "_", mafragh$spenames[colnames(flo), 1])
for(i in 1:26){
names <- gsub(LETTERS[i], letters[i], names)
}
names <- gsub("alisma_plantago", "alisma_plantago_aquatica", names)
colnames(flo) <- names
#The data on traits are in
traits <- lapply(mafragh$traits, function(x) x[colnames(flo), , drop=FALSE])
#The phylogenetic tree is in
phy <- read.tree(text=mafragh$tre)
plot(phy)

#Traits are separated by statistical type. The object traits is a list of data frames.
tabBinary <- prep.binary(traits$tabBinary, c(3, 4))
tabQuantitative <- traits$tabQuantitative
tabCircular <- prep.circular(traits$tabCircular, 1, 12)
tabOrdinal <- traits$tabOrdinal

#Analyses:
coaflo <- dudi.coa(flo, scan = FALSE, nf = 55)
vecspa <- scores.neig(mneig)
pcaspa <- dudi.pca(vecspa, coaflo$lw, scan = FALSE, nf = 96)
#We first removed environmental variables
env <- env[-(8:10)]
env[4:8] <- log(env[4:8])
pcaenv <- dudi.pca(env, coaflo$lw, scale = FALSE, scan = FALSE, nf = 8)
disT <- dist.ktab(ktab.list.df(list(tabBinary,
tabOrdinal[c("Spikiness", "Hairy leaves")])), c("B", "O"))
# The definition of the functional distances between species 
# were slightly different in Pavoine et al. (2011).

pcotraits <- dudi.pco(disT, coaflo$cw, full = TRUE)
pcophy <- dudi.pco(sqrt(as.dist(cophenetic(phy)[names(flo), names(flo)])/2), coaflo$cw, full = TRUE)


rlqmix <- rlqESLTP(pcaenv, pcaspa, coaflo, pcotraits, pcophy, scan = FALSE, nf = 2)
barplot(rlqmix$eig)
rlqmix$eig[1]/sum(rlqmix$eig)
plot(rlqmix, xy=xy, ax=1, wh="S")
plot(rlqmix, phy=phy, ax=1, wh="P")
plot(rlqmix, traits=tabBinary, ax=1, type="B", wh="T")
plot(rlqmix, traits=tabOrdinal[2:3], ax=1, type="O", wh="T")
plot(rlqmix, env=env, ax=1, type="Q", wh="E")

adegpar("plabels.optim" = O)
}

## End(Not run)

[Package adiv version 2.2.1 Index]