View source: R/msr.4thcorner.R
msr.4thcorner | R Documentation |
This function allows to test fourth-corner statistics using constrained null
models (for traits and/or environmental variables). If the argument
phyloORorthobasis
is specified, random traits are
phylogenetically-constrained to preserve the global autocorrelation (Moran's
I) and the phylogenetic structures at multiple scales. If not, standard
permutations are used. If the argument listwORorthobasis
is specified,
random environmental variables are spatially-constrained to preserve the
global autocorrelation (Moran's I) and the spatial structures at multiple
scales. If not, standard permutations are used. Multiscale property is
defined by the power spectrum (i.e. decomposition of the variance of the
original variables) on a basis of orthonormal eigenvectors (Moran's
Eigenvector Maps, MEM).
## S3 method for class ''4thcorner''
msr(
x,
listwORorthobasis,
phyloORorthobasis,
nrepet = x$npermut,
method = c("pair", "triplet", "singleton"),
...
)
x |
An object generated by the |
listwORorthobasis |
an object of the class |
phyloORorthobasis |
an object of the class |
nrepet |
an |
method |
an character specifying which algorithm should be used to
produce spatial replicates (see |
... |
further arguments of the |
An object of class 4thcorner
randomized replicates.
Stephane Dray stephane.dray@univ-lyon1.fr
Braga, J., Thuiller, W., ter Braak, C.J.F. and Dray, S. (2018) Integrating spatial and phylogenetic information in the fourth-corner analysis to test trait-environment relationships. Ecology, 99:2667-2674.
msr.default
, me.phylo
if(require("ade4", quietly = TRUE) & require("adephylo", quietly = TRUE)
& require("spdep", quietly = TRUE) & require("ape", quietly = TRUE)){
data(mafragh, package = "ade4")
fr1 <- fourthcorner(mafragh$env, mafragh$flo, mafragh$traits$tabQuantitative, nrepet = 49)
phy <- read.tree(text = mafragh$tre)
lw <- nb2listw(mafragh$nb)
fr1.msr <- msr(fr1, listwORorthobasis = lw, phyloORorthobasis = phy)
fr1
fr1.msr
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.