Description Usage Arguments Details Value Author(s) References See Also Examples
Compute distancebased Moran's eigenvector maps (dbMEM, also called dbMEM spatial eigenfunctions) from a geographic distance matrix, in view of spatial eigenfunction analysis.
1 2 
xyORdist 
Either a matrix of spatial coordinates or a distance matrix
(class 
thresh 
A threshold value for truncation of the geographic distance
matrix. If 
MEM.autocor 
A string indicating if all MEMs must be returned or only
those corresponding to nonnull, positive or negative autocorrelation. The
difference between options 
store.listw 
A logical indicating if the spatial weighting matrix should
be stored in the attribute 
silent 
A logical indicating if some information should be printed during computation: truncation level and time to compute the dbmem 
dbMEM eigenfunctions were called PCNM in early papers (Borcard and Legendre 2002, Borcard et al. 2004). There is a small difference in the computation: to construct PCNMs, the distance matrix subjected to PCoA contained zeros on the diagonal. In dbMEM, the matrix contains 4*thresh values on the diagonal. The result is that the dbMEM eigenvalues are smaller than the PCNM eigenvalues by a constant (equal to (n.sites * (4*thresh)^2)/2). The dbMEM eigenvalues are proportional to Moran's I coefficient of spatial correlation (Dray et al. 2006; Legendre and Legendre 2012). The dbMEM eigenvectors only differ from the PCNM eigenvectors by a multiplicative constant; this has no impact on the use of MEMs as explanatory variables in linear models. In this implementation, dbMEM eigenvectors have a norm equal to 1 (using the uniform weigts 1/n.sites).
If a truncation value is not provided, the largest distance in a minimum
spanning tree linking all sites on the map is computed (returned by the
function give.thresh
). That value is used as the truncation threshold
value (thresh).
A square regular grid produces multiple eigenvalues (i.e. eigenvalues that are equal) and multiple eigenvalues have an infinity of eigenvector solutions. Hence, different eigenvectors may be produced by this function on computers with different operating systems or implementations of R. In addition, the eigenvectors found by the dbmem function from the site coordinates may differ from the eigenvectors computed from the geographic distance matrix among the sites. Nonetheless, the different complete sets of eigenvectors will have the exact same explanatory power (Rsquare) for a given response vector or matrix, despite the fact that they are not fully correlated on a onetoone basis. This is, however, not the case for subsets of eigenvectors selected using stepwise procedures.
An object of class orthobasisSp
, subclass orthobasis
.
The dbMEM eigenfunctions (principal coordinates of the truncated distance
matrix) are stored as a data.frame
. It contains several attributes
(see ?attributes
) including:
values
: The dbMEM
eigenvalues.
listw
: The associated spatial weighting matrix (if
store.listw = TRUE
).
Stéphane Dray [email protected], Pierre Legendre, Daniel Borcard and F. Guillaume Blanchet
Borcard, D. and P. Legendre. 2002. Allscale spatial analysis of ecological data by means of principal coordinates of neighbour matrices. Ecological Modelling 153: 5168.
Borcard, D., P. Legendre, C. AvoisJacquet and H. Tuomisto. 2004. Dissecting the spatial structure of ecological data at multiple scales. Ecology 85: 18261832.
Dray, S., P. Legendre and P. R. PeresNeto. 2006. Spatial modelling: a comprehensive framework for principal coordinate analysis of neighbour matrices (PCNM). Ecological Modelling 196: 483493.
Legendre, P. and L. Legendre. 2012. Numerical ecology, 3rd English edition. Elsevier Science BV, Amsterdam.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46  if(require("ade4", quietly = TRUE) & require("adegraphics", quietly = TRUE)){
data(oribatid)
mite < oribatid$fau # 70 peat cores, 35 species
mite.xy < oribatid$xy # Geographic coordinates of the 70 cores
# Example 1: Compute the MEMs corresponding to all nonnull eigenvalues
# thresh=1.012 is the value used in Borcard and Legendre (2002)
mite.dbmem1 < dbmem(mite.xy, thresh=1.012, MEM.autocor = "nonnull", silent = FALSE)
mite.dbmem1
# Print the (n1) nonnull eigenvalues
attributes(mite.dbmem1)$values
# or: attr(mite.dbmem1, "values")
# Plot the associated spatial weighting matrix
s.label(mite.xy, nb = attr(mite.dbmem1, "listw"))
# Plot maps of the first 3 dbMEM eigenfunctions
s.value(mite.xy, mite.dbmem1[,1:3])
# Compute and test associated Moran's I values
# Eigenvalues are proportional to Moran's I
test < moran.randtest(mite.dbmem1, nrepet = 99)
plot(test$obs, attr(mite.dbmem1, "values"), xlab = "Moran's I", ylab = "Eigenvalues")
# Decreasing values of Moran's I for the successive MEM.
# The red line is the expected value of Moran's I under H0.
plot(test$obs, xlab="MEM rank", ylab="Moran's I")
abline(h=1/(nrow(mite.xy)  1), col="red")
# Example 2: Compute only the MEMs with positive eigenvalues (and positive Moran's I)
mite.dbmem2 < dbmem(mite.xy, thresh=1.012)
# or: mite.dbmem2 < dbmem(dist(mite.xy), thresh=1.012, silent=FALSE)
mite.dbmem2
# Examine the eigenvalues
attributes(mite.dbmem2)$values
# or: attr(mite.dbmem2, "values")
# Examine (any portion of) the dbmem spatial eigenvectors
tmp < as.matrix(mite.dbmem2)
tmp[1:10,1:6]
}

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.