get_spatial_predictors: Extract spatial predictors from spatial model

View source: R/get_spatial_predictors.R

get_spatial_predictorsR Documentation

Extract spatial predictors from spatial model

Description

Extracts the spatial predictors (Moran's Eigenvector Maps) used in a model fitted with rf_spatial().

Usage

get_spatial_predictors(model)

Arguments

model

Model object from rf_spatial() (must have class rf_spatial).

Details

Spatial predictors are Moran's Eigenvector Maps (MEMs) automatically generated and selected by rf_spatial() to capture spatial autocorrelation patterns in the data. This function extracts these predictors, which can be useful for understanding spatial structure or for making predictions on new spatial locations.

Value

Data frame containing the spatial predictor values for each observation, with predictors ordered by decreasing importance.

See Also

rf_spatial(), mem(), mem_multithreshold(), get_importance()

Other model_info: get_evaluation(), get_importance(), get_importance_local(), get_moran(), get_performance(), get_predictions(), get_residuals(), get_response_curves(), print.rf(), print_evaluation(), print_importance(), print_moran(), print_performance()

Examples

data(plants_rf_spatial)

# Extract spatial predictors
spatial_preds <- get_spatial_predictors(plants_rf_spatial)
head(spatial_preds)

# Check dimensions
dim(spatial_preds)

# View predictor names (ordered by importance)
colnames(spatial_preds)


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