data(plants_distance)
# Compute PCA spatial predictors at multiple distance thresholds
pca_predictors <- pca_multithreshold(
distance.matrix = plants_distance,
distance.thresholds = c(0, 1000, 5000)
)
# View structure
head(pca_predictors)
dim(pca_predictors)
# Check predictor names (show scale information)
colnames(pca_predictors)[1:6]
# Limit number of predictors to save memory
pca_limited <- pca_multithreshold(
distance.matrix = plants_distance,
distance.thresholds = c(0, 1000, 5000),
max.spatial.predictors = 20
)
ncol(pca_limited) # At most 20 predictors
Run the code above in your browser using DataLab