View source: R/mem_multithreshold.R
mem_multithreshold | R Documentation |
Computes Moran's Eigenvector Maps of a distance matrix (using mem()
) over different distance thresholds.
mem_multithreshold( distance.matrix = NULL, distance.thresholds = NULL, max.spatial.predictors = NULL )
distance.matrix |
Distance matrix. Default: |
distance.thresholds |
Numeric vector with distance thresholds defining neighborhood in the distance matrix, Default: |
max.spatial.predictors |
Maximum number of spatial predictors to generate. Only useful to save memory when the distance matrix |
The function takes the distance matrix x
, computes its weights at difference distance thresholds, double-centers the resulting weight matrices with double_center_distance_matrix()
, applies eigen to each double-centered matrix, and returns eigenvectors with positive normalized eigenvalues for different distance thresholds.
A data frame with as many rows as the distance matrix x
containing positive Moran's Eigenvector Maps. The data frame columns are named "spatial_predictor_DISTANCE_COLUMN", where DISTANCE is the given distance threshold, and COLUMN is the column index of the given spatial predictor.
if(interactive()){ #loading example data data(distance_matrix) #computing Moran's eigenvector maps for 0, 1000, and 2000 km mem.df <- mem_multithreshold( distance.matrix = distance_matrix, distance.thresholds = c(0, 1000, 2000) ) head(mem.df) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.