default_distance_thresholds: Default distance thresholds for spatial predictors

View source: R/default_distance_thresholds.R

default_distance_thresholdsR Documentation

Default distance thresholds for spatial predictors

Description

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.

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.

Value

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

See Also

Other preprocessing: auto_cor(), auto_vif(), case_weights(), double_center_distance_matrix(), is_binary(), make_spatial_fold(), make_spatial_folds(), the_feature_engineer(), weights_from_distance_matrix()

Examples

data(plants_distance)

thresholds <- default_distance_thresholds(
  distance.matrix = plants_distance
)

thresholds
# Example output: c(0, 3333, 6666, 10000)
# Four evenly-spaced thresholds from 0 to max(plants_distance)/2


spatialRF documentation built on Dec. 20, 2025, 1:07 a.m.