View source: R/pca_multithreshold.R
pca_multithreshold | R Documentation |
Computes PCA factors of a distance matrix over different distance thresholds to generate spatial predictors for a model fitted with rf_spatial()
.
pca_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 |
Integer, maximum number of spatial predictors to generate. Only useful when the distance matrix |
The distance matrix is converted into weights with weights_from_distance_matrix()
before computing the PCA. This produces more meaningful spatial predictors than using the distance matrix as is.
A data frame with the PCA factors of the thresholded matrix. 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 predictor.
pca()
if(interactive()){ #loading example distance matrix load(distance_matrix) #PCA factors of the distance matrix for two reference distances x <- pca_multithreshold( distance.matrix = distance_matrix, distance.thresholds = c(0, 1000) ) head(x) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.