This RMarkdown script provides a framework for Species Distribution Modeling (SDM) and ecological niche analysis under present and future climate scenarios under different trajectories. Using MaxEnt, it models species distributions based on both BioClim and Land Use data applying 10-fold cross-validation. Model parameterization is performed for feature class (fc) and regularization multiplier (rm) using ENMeval::ENMevaluate
.
- Species Record Retrieval: Extracts georeferenced records from GBIF, iNaturalist, or Observation.org based on species name, country, and continent.
- Climate and Land Use Data: Incorporates WorldClim’s BioClim variables and land use data (e.g., vegetation, population density).
- Database selection: Choose between gbif, inaturalist and observation.org as data sources for species occurrences and set restrictions regarding country/continent.
- Future Projections: Models species distribution under various CMIP6 climate models across SSPs 126, 245, 370, and 585 for 2041-2060 and 2061-2080.
- Custom Plotting: Visualize the predicted SDM or ecological niche within specified coordinate ranges. Plotting range does not need to overlap range of occurrences (relevant for invasives).
- Distribution ranges: Distribution ranges can be estimated using a dynamic alpha-hull approach, restricting predictions to the distribution range. (this feature can be toggled on or off)
- multicollinearity: Highly correlated (r>0.75) predictors within the range of the specified occurrences are automaticcaly removed.
- Parameterization: Every MaxEnt model is finetuned with optimal feature class (fc) and regularization multiplier (rm) parameters.
Clone this repository and run the script in an R environment. To specify parameters, edit them within the params
list or interact with the user interface when the document is knitted in RStudio.
Parameter | Description |
---|---|
Species | Scientific name of the species |
Country | Optional 2-letter country code |
Continent | Select continent or specify all |
Database | Choose from gbif , inaturalist , observation |
Climate.model | CMIP6 climate model for future predictions |
SSP | Shared Socioeconomic Pathway (126, 245, 370, 585) |
Working Directory | Path to save results |
The script requires the following packages:
dismo
,raster
,rgbif
,sf
,rmaxent
,rJava
,rasterVis
,viridis
,geodata
,ggplot2
,stringr
,rnaturalearth
,caret
,dichromat
,dplyr
,kableExtra
,rangeBuilder
,ENMeval
,cowplot
- BioClim: 19 variables including temperature and precipitation measures.
- Land Use: Variables representing vegetation, built environments, water bodies, population density, human footprint, and elevation.
For more details on Land Use data, see geodata documentation.
You can use the Process_species.R script to loop over multiple species stored in a 1-column format in a .txt document containing the scientific names. Parameter values can be modified in the script and override the defaults in the markdown script.
Please make a reference to this github page when using this tool in publications.
This project is licensed under the MIT License. Contributions and improvements are welcome!