Skip to contents

Generates four evenly-spaced distance thresholds for spatial predictor generation, ranging from 0 to half the maximum distance in the matrix.

Usage

default_distance_thresholds(distance.matrix = NULL)

Arguments

distance.matrix

Numeric distance matrix (typically square and symmetric). Default: NULL.

Value

Numeric vector of length 4 with distance thresholds (floored to integers).

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