Changelog
Source:NEWS.md
h3sdm 0.1.5
New functions
-
h3sdm_pres()assigns species occurrence records to H3 hexagons and returns only hexagons with at least one presence record. This is the first step of a two-stage workflow where pseudo-absences are generated after environmental variables have been extracted. -
h3sdm_pa()has been redesigned to generate pseudo-absences stratified in environmental space using k-means clustering. Pseudo-absences now cover the full range of environmental conditions available in the AOI, reducing environmental bias introduced by spatially clustered occurrence records. The function now receives presence hexagons fromh3sdm_pres()and the full hexagonal grid with extracted variables fromh3sdm_predictors().
Improvements
-
h3sdm_pa()andh3sdm_pa_from_records()now accept abuffer_kargument (default1). Hexagons withinbuffer_kH3 rings of any presence hexagon are excluded from the pseudo-absence candidate pool, preventing pseudo-absences from being placed in areas likely occupied but not yet recorded. Set to0to disable. -
h3sdm_pa_from_records()now accepts an optionalpredictors_sfargument. When provided, pseudo-absences are selected by stratified sampling in environmental space using k-means clustering. IfNULL(default), the previous random geographic sampling behaviour is preserved.
Bug fixes
-
h3sdm_aoa()now extracts predictor variable names from the model recipe instead of the model formula, fixing an error with GLM and other engines where parsnip stores a generic formula internally. -
h3sdm_aoa()now usesna.rm = TRUEwhen computing the inside/outside AOA summary, avoidingNAin the progress message when hexagons have missing values.
h3sdm 0.1.4
CRAN release: 2026-05-29
Bug fixes
-
h3sdm_pa()now transforms presence records to the CRS of the H3 grid before joining, fixing an error when the grid is in a projected CRS.
h3sdm 0.1.3
CRAN release: 2026-05-28
New functions
-
h3sdm_aoa()estimates the Dissimilarity Index (DI) and the Area of Applicability (AOA) for spatial prediction models, based on Meyer & Pebesma (2021).
Improvements
-
h3sdm_get_grid()now preserves the CRS of the inputsf_object. Previously, the function always returned the grid in WGS84 (EPSG:4326) regardless of the input CRS. Now, if the AOI is in a projected CRS, the output grid will be reprojected to match it. The internal H3 computation still uses WGS84 as required by the H3 system. -
h3sdm_predict()internal comments translated to English and@seealsoupdated to includeh3sdm_aoa().
h3sdm 0.1.2
CRAN release: 2026-05-22
Improvements
h3sdm_fit_model()now automatically detects model mode (classification or regression), enabling count-based models (Poisson, Negative Binomial) with appropriate metrics (RMSE, R², MAE) without requiring manual configuration.h3sdm_fit_model()andh3sdm_predict()now automatically detect model mode (classification or regression), enabling count-based models (Poisson, Negative Binomial) without manual configuration. Full backward compatibility maintained.h3sdm_get_records()now supports"biodatacr"as an optional provider, querying occurrence records from BiodataCR (Costa Rica) via therbiodatacrpackage.h3sdm_pa()inherits this support automatically through itsprovidersargument.rbiodatacris listed as a suggested dependency.
h3sdm 0.1.1
CRAN release: 2026-05-13
New functions
h3sdm_pa_from_records(): generates a presence/pseudo-absence dataset from user-provided records. Accepts adata.frameorsfobject with coordinates in WGS84 (EPSG:4326). Supports optional filtering by ageospatialKoshercolumn to remove records with questionable spatial quality.h3sdm_count_from_records(): generates a hexagonal grid with count-based response variables (species richness, total detections, or individual abundance) from user-provided records. Accepts adata.frameorsfobject. Supports optional filtering by presence column, confidence threshold, and date range.
Changes to existing functions
h3sdm_recipe(): addedresponse_colparameter (default"presence") to support count-based response variables. Useresponse_col = "count"when working with data generated byh3sdm_count_from_records().h3sdm_recipe_gam(): addedresponse_colparameter (default"presence") with the same behavior ash3sdm_recipe(). Also added documentation examples for both presence/absence and count-based models.h3sdm_workflow_gam(): updated documentation to clarify the use ofset_mode("classification")for presence/absence models andset_mode("regression")withfamily = poisson()for count-based models.h3sdm_workflow(): updated documentation to clarify model mode selection for presence/absence and count-based models.h3sdm_workflows(): updated documentation to clarify model mode selection for presence/absence and count-based models.