Changelog
Source:NEWS.md
flexsdm 1.4.2
CRAN release: 2026-10-24
-
tune_max: a grid combination whose fits all failed was assigned the previous combination’s model/performance (stalemod); now initialised toNULLand checked withis.null()(#478) -
fit_max: the final refit fallback used the CV loop index in its check and could discard a successful fit; it now usesis.null(mod)and falls back on presences + background (data_2) (#478) -
tune_svm: removedna.omit()on partition performance so all combinations are compared across the same partitions (#478) -
fit_gbm: final model now usesbag.fraction = 0.9, consistent with the CV models;tune_gbmvalidity guard also uses 0.9 (#478) -
occfilt_geo: moran method no longer collapses to one record (Infdistance) when no Moran’s I falls in the selection window; the closest value is used, and the threshold comparison is now numeric (#479) -
sample_pseudoabs: factormaskvalnow matches raster category IDs in the kmeans, env_const, env_clust and env_kmeans methods (#479) -
get_absences: NA in the species column no longer creates phantom NA rows (#479) -
calib_area: mcp/bmcp with three or more groups no longer errors (#479) -
part_sband: fixed uninitialisedimoran_bands_cassignment (#479) - CRAN review: every exported function now has a small, fast example that is executed on CRAN (the longer examples remain inside
\donttest{}); examples ofsdm_directory()andhomogenize_na()/extra_eval()no longer leave files in the working directory or alterpar() -
sdm_directory:main_dirno longer defaults to a sub-folder of the working directory and must be provided by the user - Functions no longer call
set.seed()with a fixed number (fit_*,occfilt_geo,correct_colinvar,p_extra, …). Results can be reproduced by callingset.seed()before running them;tune_*,sdm_varimpandsdm_uncertaintydraw the seeds used by parallel workers from the caller’s random-number stream -
tune_gbm,tune_max,tune_net,tune_raf,tune_svm,sdm_varimpandsdm_uncertainty: no cluster is started whenn_cores = 1, the computation runs sequentially in the current session -
occfilt_geo: thewarnoption is restored when the function exits - Gaussian process code used by
fit_gau()andesm_gau(),fit_max()andtune_max():print()andcat()calls replaced bymessage()orwarning()(or removed) - Check time after the last CRAN incoming check (examples took 161 s and tests 104 s on win-builder): the examples executed on CRAN are now tiny toy examples without plotting (the full examples, with their plots, are inside
\donttest{}), test files that take more than a fraction of a second are skipped as a whole on CRAN withskip_on_cran()(they run whenNOT_CRAN=true), and vignettev04is now precomputed (source invignettes/v04_Red_fir_example.Rmd.orig) -
DESCRIPTION: reworded “ensembling” in the Description field
flexsdm 1.4.1
-
get_absences: Function to build a presence-absence database from multi-species occurrence data, by @sjevelazco -
occ_reproject: Function to reproject occurrence coordinates to a new coordinate reference system, by @sjevelazco - minor warnings and package formality were fixed, by @sjevelazco 467
-
correct_colinvar: Unicode box-drawing characters in the documentation’s example directory tree were replaced with plain ASCII, fixing a LaTeX error that caused the PDF manual build to fail on CRAN, by @sjevelazco - Vignette
v07_Complete_workflow: two dataset links were missing thehttps://scheme (www.doi.org/...), which CRAN flagged as invalid URIs; fixed tohttps://doi.org/..., by @sjevelazco -
tune_max: fixed a bug where the default hyperparameter grid (used whengrid = NULL) tested aregmultstep of 0.05 instead of the documented 0.5, producing ~10x more combinations than intended, by @sjevelazco - Test suite and vignette runtimes were substantially reduced in response to CRAN’s request (test suite ~17 min -> ~3 min; vignette rebuilding ~14 min -> ~2 min, as measured locally) by shrinking hyperparameter grids, dataset sizes, and replicate/fold counts in tests and vignettes, and by gating the most expensive/redundant test cases behind
skip_on_cran(), by @sjevelazco - Further reduced test and vignette runtimes after win-builder’s automated “Overall checktime > 10 min” rejection, by gating most secondary/edge-case assertions in the
tune_*andsdm_uncertaintytest files behindskip_on_cran()(kept a representative case running on CRAN for each), and by shrinking dataset sizes and search-grid sizes (part_sband,part_sblock,occfilt_env,occfilt_geo) further in the vignettes, by @sjevelazco - Test and vignette runtimes were cut again after CRAN’s incoming check (tests ~6 min, vignettes ~6 min on win-builder): all but one representative
test_that()block per test file (or none for the slowest files) now run only whenNOT_CRAN=true, and vignettesv01,v02,v03,v05andv06are now precomputed (source invignettes/*.Rmd.orig, excluded from the build), by @sjevelazco - Shortened the
\donttest{}examples of the slowest functions (sdm_varimp,fit_max,fit_gau,tune_*,esm_gam,fit_gam,occfilt_geo,sdm_summarize,esm_max) by using smaller hyperparameter grids, fewer folds/replicates and subsampled datasets (~10 min -> ~3.5 min locally), by @sjevelazco -
fit_raf: thentreeargument was ignored in the no-partition fit and in the cross-validation fits (hardcoded to 500); it is now used everywhere, reported in #474, by @sjevelazco -
tune_raf: the final model now uses the tunedntreeinstead of therandomForestdefault, #474, by @sjevelazco -
esm_gbm:n_treesandshrinkagewere hardcoded and are now forwarded tofit_gbm;esm_net:sizeanddecayare now forwarded tofit_net, #474, by @sjevelazco -
esm_svm:performance_partwas labelledesm_gau; nowesm_svm.fit_svmandfit_max: partition ids inperformance_partwere wrong (earlier folds were relabelled), #474, by @sjevelazco - Removed the DeepWiki badge from
README.md, whose URL returned HTTP 429 in CRAN’s URL check, by @sjevelazco -
sdm_eval: fixed a bug in the KAPPA metric calculation, by @sjevelazco -
sample_backgroundandsample_pseudoabs: fixed three bugs in categoricalmaskval/k-means handling reported in #472:maskvalon a factor raster was resolved to its row position in the levels table instead of its actual category ID; the k-means branch ofsample_pseudoabsmasked and overwrote the environmental raster with the region raster instead of the other way around; and the internalkf()helper could fail with “differing number of rows” when the environmental raster had no NA cells, by @sjevelazco
flexsdm 1.4.0
-
map_env_dist: C++ function to calculate Euclidean and Mahalanobis distance was implemented, by @sjevelazco 463 -
extra_eval: C++ function to calculate Euclidean and Mahalanobis distance was implemented, by @sjevelazco 463 -
fit_dom: C++ function to calculate gower distance was optimized, by @sjevelazco 463 -
map_env_dist: C++ function to calculate gower distance was optimized, by @sjevelazco 463 -
msdm_posteriori: a new argument that assumes unsuitable cells with presences as patches. This is only used in the ‘lq’ approach, by @sjevelazco 461 -
sdm_eval: Boyce metric was readapted based on enmSdmX package, by @sjevelazco 457 -
msdm_posteriori: now car return semi-binary suitability maps, by @sjevelazco 455 -
part_senv: new argument to use or not presences-absences coordinate to perform environmental partition, by @sjevelazco 445
flexsdm 1.3.9
-
map_env_distwas improved. Now it is possible to calculate Euclidean and Mahalanobis distances in addition to the Gower distance (Domain algorithm), by @sjevelazco. -
sdm_eval()now calculates three additional performance metrics: the Matthews Correlation Coefficient (MCC). the Continuous Ranked Probability Score (CRPS), and a prevalence-weighted average of TPR and TNR (W_TPR_TNR), by @sjevelazco 445. -
fit_gbm()andtune_gbm()were improved to prevent theargument is of length zeroerror. This was achieved by adding a safeguard that dynamically adjustsn.minobsinnodebased on the size of the training data partition, ensuring it remains valid for thegbmalgorithm, by @sjevelazco 445. -
sdm_uncertaintyThis new function calculates species distribution model uncertainty using a bootstrap procedure, by @sjevelazco #442 - fit_ functions now can handle partition = NULL, by @sjevelazco #442
- A new vignette demonstrating how to model several species and periods of time was added by @mrose048 @sjevelazco @iminoli-dev 438
flexsdm 1.3.8
-
fit_, tune_, esm_ andfit_ensemblefunctions now return a performance table for each partition and replicate (performance_part), by @sjevelazco #432 and 434 -
p_pdpwas improved to depict exactly training range values when projection data are used, by @sjevelazco #429 -
sample_pseudoabsa sample approach was implemented based on environmental K-means, by @sjevelazco #410 -
sample_pseudoabsK-means step was improved for the geoenv_const_kmeans approach, by @sjevelazco #410 -
p_extraNow can handle binary maps to plot suitability or extrapolation values in the geographical or environmental space, by @sjevelazco 418 -
map_env_distThis new function calculates environmental distance between presences and projection data. Only the nearest Gower distance was implemented (Domain algorithm), by @sjevelazco 419 -
fit_domThis is a new function to fit and validate the Domain algorithm, by @sjevelazco
flexsdm 1.3.6
-
occfilt_geoadapted to test different values for the three methods by @sjevelazco in 386 -
occfilt_envnow can filter with several bins by @sjevelazco in 388 -
occfilt_selectwas created and a test protocol was written by @sjevelazco in 389 -
occfit_selectincluded in vignette and website by @sjevelazco in 390 - mean change in
sdm_predictto handle 0 weight value for weighted mean by @sjevelazco in 391 - documentation of
occfilt_selectwas improved by @sjevelazco in 392 - It is possible to tune ntree hyperparameter of random forest algorithm by @sjevelazco in 393
-
correct_colinvarcan be used with species points by @sjevelazco in 394 - Update pkg_citation.md by @mrose048 in 396
-
sdm_varimpwas added and tested by @mrose048 and @sjevelazco in 399 - min change in warning message
calib_areaby @sjevelazco in 400
flexsdm 1.3.4-5
- min change in
interpfunction by @sjevelazco in 362 - min change in
occfilt_geoby @sjevelazco in 364 - Rlof was removed from dependencies by @sjevelazco in 365
- min change in
occfilt_geoby @sjevelazco in 370 - new argument in
occfilt_geoby @sjevelazco in 371 -
esm_functions were improved by @sjevelazco in 373 & 373 - geographically constraint cell of env_var argument in
correct_colinvarby @sjevelazco in 374 - new argument in
correct_colinvarby @sjevelazco in 375 -
calib_areawas sped up by @sjevelazco in 377 -
correct_colivarwas fixed and improved, FA method by @sjevelazco in 383 -
occfilt_geo‘defined’ method was fixed by @sjevelazco in 384
flexsdm 1.3.4
- it is possible to restrict the cell used to perform collinearity reduction analysis to a geographical area smaller than the full extent of environmental variables in
correct_clinvar() - esm_ family function was improved and debugged
-
occfilt_geohas a new argument “rep” to control number o repetition to filter occurrences
flexsdm 1.3.4
- rgeos was removed from dependencies #356
- New vignette about how use different tools to explore model extrapolation and truncate models was added #352
- Univariate and combinatorial extrapolation metric added to
extra_eval. - Minor bugs were fixed to project PCA for other time periods #351
- Best grid raster names was changed to .part in
part_sblockandpart_sband - Improvements in
correct_colinvarto speed up function when using maxcell argument - Improvements in
correct_colinvarto project PCA for other time periods
flexsdm 1.3.3
- Improvements in
correct_colinvarIt is now possible to sample rasters to reduce machine memory and speed up the process - Improvements in
sdm_predictIt is possible predict model in chunks to reduce machine memory -
p_extra,p_pdp, andp_bpdpwere fixed - New function
p_bpdpBivariate Partial Dependent Plot - New function
data_bpdpCalculate data to construct bivariate partial dependence plots - Improvements in
p_dpdCalculate data to construct partial dependence plots
flexsdm 1.3.2
- New function
p_extraGraphical exploration of extrapolation or suitability pattern in the environmental and geographical space - New function
p_pdpPartial Dependent Plot - New function
data_pdpCalculate data to construct partial dependence plots
flexsdm 1.3.1
- New argument “crs” added to function
msdm_posteriori - New argument “sp_name” in
sample_backgroundandsample_pseudoabs - raster, flexclust, ape, and sp were removed from dependencies
- Functions using CRS data have improved codes
- It is possible use a numeric value to specify threshold in
msdm_posteriori -
extra_evalcan use tibble or SpatRaster object in env_calib argument -
extra_truncatehas a new argument to define values used for model truncation and documentation was improved. #