| spatialEigenvectors | R Documentation |
Compute spatial eigenvectors from site coordinates using Principal Coordinates of Neighbour Matrices (PCNM) or distance-based Moran's Eigenvector Maps (dbMEM).
spatialEigenvectors(
coords,
threshold = NULL,
method = c("pcnm", "dbmem"),
distance = c("euclidean", "haversine")
)
coords |
A data.frame with columns |
threshold |
Numeric. Distance threshold for truncation. Default |
method |
Character. |
distance |
Character. |
PCNM (Borcard & Legendre 2002) decomposes spatial structure into orthogonal eigenvectors representing patterns at different spatial scales. Large eigenvalues correspond to broad-scale patterns (positive spatial autocorrelation), while small eigenvalues represent fine-scale patterns.
The algorithm:
Compute pairwise distances
Truncate distances beyond threshold (set to 4 * threshold)
Double-centre the squared truncated distance matrix
Extract eigenvectors with positive eigenvalues
For "dbmem": additionally filter to Moran's I > 0
An object of class spacc_mem containing:
vectors |
Matrix of eigenvectors (sites x n_vectors) |
eigenvalues |
Positive eigenvalues |
moran_i |
Moran's I for each eigenvector |
threshold |
Truncation distance used |
coords |
Original coordinates |
n_sites |
Number of sites |
method |
Method used |
Borcard, D. & Legendre, P. (2002). All-scale spatial analysis of ecological data by means of principal coordinates of neighbour matrices. Ecological Modelling, 153, 51-68.
Dray, S., Legendre, P. & Peres-Neto, P.R. (2006). Spatial modelling: a comprehensive framework for principal coordinate analysis of neighbour matrices (PCNM). Ecological Modelling, 196, 483-493.
spatialPartition() for variance partitioning with MEMs
coords <- data.frame(x = runif(30), y = runif(30))
mem <- spatialEigenvectors(coords)
print(mem)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.