Default distance thresholds for spatial predictors
Source:R/default_distance_thresholds.R
default_distance_thresholds.RdGenerates four evenly-spaced distance thresholds for spatial predictor generation, ranging from 0 to half the maximum distance in the matrix.
Details
The maximum threshold is set to half the maximum distance to avoid spatial predictors based on distances that are too large to capture meaningful spatial autocorrelation. The four thresholds are evenly spaced using seq() with length.out = 4.
Examples
data(plants_distance)
thresholds <- default_distance_thresholds(
distance.matrix = plants_distance
)
thresholds
#> [1] 0 2399 4798 7198
# Example output: c(0, 3333, 6666, 10000)
# Four evenly-spaced thresholds from 0 to max(plants_distance)/2