Learn R Programming

caretSDM

Luíz Fernando Esser

caretSDM

caretSDM is a under development R package that uses the powerful caret package as the main engine to obtain Species Distribution Models. As caret is a packaged turned to build machine learning models, caretSDM has a strong focus on this approach.

Installation

You can install the development version of caretSDM from GitHub with:

install.packages("devtools")
devtools::install_github("luizesser/caretSDM")

The package is also available on CRAN. Users are able to install it using the following code:

install.packages("caretSDM")

You need help?

caretSDM is vastly documented and has included some objects that can guide your data management. If some of your data or code seem to be wrong, try to take a look at those objects or the articles in the website:

Objects

  • bioc Bioclimatic variables for current scenario in stars class.

  • rivs Hydrological variables for current scenario in sf class.

  • occ Araucaria angustifolia occurrence data as a dataframe.

  • salm Salminus brasiliensis occurrence data as a dataframe.

  • parana Shapefile to use in sdm_area in Simple Feature class.

  • scen Bioclimatic variables for future scenarios in stars class.

  • algorithms Dataframe with characteristics from every algorithm available in caretSDM.

Articles

  • caretSDM Workflow for Species Distribution Modeling is the main vignette for terrestrial species modeling, where we model the tree species Araucaria angustifolia.

  • Modeling Species Distributions in Continental Water Bodies is the main vignette for continental aquatic species modeling, where we model the fish species Salminus brasiliensis.

  • Concatenate functions in caretSDM shows how to build compact scripts, which is very useful to run your first tests.

  • Adding New Algorithms to caretSDM Do not found your ideal algorithm already implemented? Here we show how to implement any custom algorithm in our package.

Copy Link

Version

Install

install.packages('caretSDM')

Version

1.1.0.1

License

MIT + file LICENSE

Maintainer

Luíz Esser

Last Published

July 10th, 2025

Functions in caretSDM (1.1.0.1)

pca_predictors

Predictors as PCA-axes
predict_sdm

Predict SDM models in new data
join_area

Join Area
occ

Araucaria angustifolia occurrence data
occurrences_sdm

Occurrences Managing
parana

Paraná State
pdp_sdm

Model Response to Variables
predictors

Predictors Names Managing
print.input_sdm

Print method for input_sdm
sdm_area

Create a sdm_area object
scen

Bioclimatic Variables
use_mem

MacroEcological Models (MEM) in caretSDM
summary_sdm

Calculates performance across resamples
sdm_as_stars

sdm_as_X functions to transform caretSDM data into other classes.
tsne_sdm

tSNE
rivs

Hydrologic Variables
pseudoabsences

Obtain Pseudoabsences
salm

Salminus brasiliensis occurrence data
print.predictions

Print method for predictions
write_ensembles

Write caretSDM data
select_predictors

Tidyverse methods for caretSDM objects
train_sdm

Train SDM models
print.models

Print method for models
print.occurrences

Print method for occurrences
varImp_sdm

Calculation of variable importance for models
vif_predictors

Calculate VIF
gcms_ensembles

Ensemble GCMs into one scenario
add_predictors

Add predictors to sdm_area
data_clean

Presence data cleaning routine
GBIF_data

Retrieve Species data from GBIF
buffer_sdm

Create buffer around occurrences
algorithms

Caret Algorithms
add_scenarios

Add scenarios to sdm_area
is_input_sdm

is_class functions to check caretSDM data classes.
input_sdm

input_sdm
caretSDM-package

caretSDM: Build Species Distribution Modeling using 'caret'
bioc

Bioclimatic Variables
WorldClim_data

Download WorldClim v.2.1 bioclimatic data
plot_occurrences

S3 Methods for plot and mapview