plot_optimization: Optimization plot of a selection of spatial predictors

View source: R/plot_optimization.R

plot_optimizationR Documentation

Optimization plot of a selection of spatial predictors

Description

Plots optimization data frames produced by select_spatial_predictors_sequential() and select_spatial_predictors_recursive().

Usage

plot_optimization(
  model,
  point.color = viridis::viridis(
    100,
    option = "F",
    direction = -1
  ),
  verbose = TRUE
)

Arguments

model

A model produced by rf_spatial(), or an optimization data frame produced by select_spatial_predictors_sequential() or select_spatial_predictors_recursive().

point.color

Colors of the plotted points. Can be a single color name (e.g. "red4"), a character vector with hexadecimal codes (e.g. "#440154FF" "#21908CFF" "#FDE725FF"), or function generating a palette (e.g. viridis::viridis(100)). Default: viridis::viridis(100, option = "F", direction = -1)

verbose

Logical, if TRUE the plot is printed. Default: TRUE

Details

The function returns NULL invisibly (without plotting) when:

  • The method used to fit a model with rf_spatial() is "hengl" (no optimization required)

  • No spatial predictors were selected during model fitting

  • The model is non-spatial

Value

A ggplot, or NULL invisibly if no optimization data is available.

See Also

Other visualization: plot_evaluation(), plot_importance(), plot_moran(), plot_residuals_diagnostics(), plot_response_curves(), plot_response_surface(), plot_training_df(), plot_training_df_moran(), plot_tuning()

Examples


data(plants_rf_spatial)

plot_optimization(plants_rf_spatial)


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