Skip to content

Uses a fitted tidymodels workflow (from h3sdm_fit_model or a standalone workflow) to predict species presence probabilities on a new spatial H3 grid. Automatically generates x and y coordinates from polygon centroids if missing.

Usage

h3sdm_predict(fit_object, new_data)

Arguments

fit_object

A fitted tidymodels workflow or the output list from h3sdm_fit_model.

new_data

An sf object containing the spatial grid and the same predictor variables used for model training.

Value

An sf object with the original geometry and a new column prediction containing the predicted probability of presence for each hexagon.

Examples

if (FALSE) { # \dontrun{
# Assuming 'fitted_model' is the result of h3sdm_fit_model()
# and 'grid_sf' is an sf object with predictor variables
predictions_sf <- h3sdm_predict(fit_object = fitted_model,
                                new_data   = grid_sf)
} # }