enmSdmX
A set of tools in R for implementing species distribution models and ecological niche models.
https://github.com/adamlilith/enmSdmX
Category: Biosphere
Sub Category: Species Distribution Modeling
Keywords
bias-correction biogeography ecological-niche-modeling ecological-niche-modelling niche-modeling niche-modelling species-distribution-modeling
Keywords from Contributors
species-distribution-models
Last synced: about 1 hour ago
JSON representation
Repository metadata
Tools for Modeling Niches and Distributions of Species
- Host: GitHub
- URL: https://github.com/adamlilith/enmSdmX
- Owner: adamlilith
- License: other
- Created: 2022-10-27T03:05:23.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2025-02-20T04:16:13.000Z (2 months ago)
- Last Synced: 2025-04-10T05:38:35.106Z (17 days ago)
- Topics: bias-correction, biogeography, ecological-niche-modeling, ecological-niche-modelling, niche-modeling, niche-modelling, species-distribution-modeling
- Language: R
- Homepage:
- Size: 11.1 MB
- Stars: 25
- Watchers: 1
- Forks: 3
- Open Issues: 0
- Releases: 2
-
Metadata Files:
- Readme: README.md
- Changelog: NEWS.md
- License: LICENSE
README.md
enmSdmX
Tools for modeling niches and distributions of species
enmSdmX
is a set of tools in R for implementing species distribution models (SDMs) and ecological niche models (ENMs), including: bias correction, spatial cross-validation, model evaluation, raster interpolation, biotic velocity (speed and direction of movement of a "mass" represented by a raster), and tools for using spatially imprecise records. The heart of the package is a set of "training" functions which automatically optimize model complexity based number of available occurrences. These algorithms include MaxEnt, MaxNet, boosted regression trees/gradient boosting machines (BRT), generalized additive models (GAM), generalized linear models (GLM), natural splines (NS), and random forests (RF). To enhance interoperability with other packages, the package does not create any new classes. The package works with PROJ6 geodetic objects and coordinate reference systems.
Installation
You can install this package from CRAN using:
install.packages('enmSdmX', dependencies = TRUE)
Alternatively, you can install the development version of this package using:
remotes::install_github('adamlilith/enmSdmX', dependencies = TRUE)
You may need to install the remotes
package first.
Functions
Using spatially imprecise records
coordImprecision
: Coordinate imprecisionnearestGeogPoints
: Minimum convex polygon from a set of spatial polygons and/or points ("nearest geographic point" method)nearestEnvPoints
: Extract "most conservative" environments from points and/or polygons ("nearest environmental point" method)
Data preparation
elimCellDuplicates
: Eliminate duplicate points in each cell of a rastergeoFold
: Assign geographically-distinct k-foldsgeoFoldContrast
: Assign geographically-distinct k-folds to background or contrast sites
Bias correction
geoThin
: Thin geographic points deterministically or randomlyweightByDist
: Proximity-based weighting for occurrences for correcting spatial bias
Model training
trainByCrossValid
andsummaryByCrossValid
: Calibrate a distribution/niche model using cross-validationtrainBRT
: Boosted regression trees (BRTs)trainESM
: Ensembles of small models (ESMs)trainGAM
: Generalized additive models (GAMs)trainGLM
: Generalized linear models (GLMs)trainMaxEnt
: MaxEnt modelstrainMaxNet
: MaxNet modelstrainNS
: Natural splines (NSs)trainRF
: Random forests (RFs)
Model prediction
predictEnmSdm
: Predict most model types using default settings; parallelizedpredictMaxEnt
: Predict MaxEnt modelpredictMaxNet
: Predict MaxNet model
Model evaluation
evalAUC
: AUC (with/out site weights)evalMultiAUC
: Multivariate version of AUC (with/out site weight)evalContBoyce
: Continuous Boyce Index (with/out site weights)evalThreshold
: Thresholds to convert continuous predictions to binary predictions (with/out site weights)evalThresholdStats
: Model accuracy based on thresholded predictions (with/out site weights)evalTjursR2
: Tjur's R2 (with/out site weights)evalTSS
: True Skill Statistic (TSS) (with/out site weights)modelSize
: Number of response values in a model object
Response curves and niche overlap
compareResponse
: Compare different niche model responses along an environmental variablenicheOverlapMetrics
: Niche overlap metricsresponseCurves
: Plot response curves for one or more models
Functions for rasters
bioticVelocity
: Velocity of a "mass" across a time series of rastersgetValueByCell
andsetValueByCell
: Retrieve or get raster values(s) by cell numberglobalx
: "Friendly" wrapper for terra::global() for calculatig raster statisticsinterpolateRasts
: Interpolate a stack of rasterslongLatRasts
: Generate rasters with values of longitude/latitude for cell valuessampleRast
: Sample raster with/out replacementsquareCellRast
: Create a raster with square cells from an object with an extent
Coordinate reference systems
crss
: Coordinate reference systems and their nicknamescustomAlbers
: Create a custom Albers conic equal-area projectioncustomLambert
: Create a custom Lambert azimuthal equal-area projectioncustomVNS
: Create a custom vertical near-side projectiongetCRS
: Return a WKT2 (well-known text) string using a nickname
Geographic utility functions
countPoints
: Number of points in a "spatial points" objectdecimalToDms
: Convert decimal coordinate to degrees-minutes-secondsdmsToDecimal
: Convert degrees-minutes-seconds coordinate to decimalextentToVect
: Convert extent to a spatial polygonplotExtent
: Create a spatial polygon the same size as a plot regionspatVectorToSpatial
: Convert SpatVector object to a Spatial* object
Data
lemurs
: Lemur occurrencesmad0
: Madagascar spatial objectmad1
: Madagascar spatial objectmadClim
: Madagascar climate rasters for the presentmadClim2030
: Madagascar climate rasters for the 2030smadClim2050
: Madagascar climate rasters for the 2050smadClim2070
: Madagascar climate rasters for the 2070smadClim2090
: Madagascar climate rasters for the 2090s
Citation
Smith, A.B., Murphy, S.J., Henderson, D., and Erickson, K.D. 2023. Including imprecisely georeferenced specimens improves accuracy of species distribution models and estimates of niche breadth. Global Ecology and Biogeography In press. [open access pre-print | published article]
Abstract
Aim Museum and herbarium specimen records are frequently used to assess the conservation status of species and their responses to climate change. Typically, occurrences with imprecise geolocality information are discarded because they cannot be matched confidently to environmental conditions and are thus expected to increase uncertainty in downstream analyses. However, using only precisely georeferenced records risks undersampling of the environmental and geographical distributions of species. We present two related methods to allow the use of imprecisely georeferenced occurrences in biogeographical analysis.
Innovation Our two procedures assign imprecise records to the (1) locations or (2) climates that are closest to the geographical or environmental centroid of the precise records of a species. For virtual species, including imprecise records alongside precise records improved the accuracy of ecological niche models projected to the present and the future, especially for species with c. 20 or fewer precise occurrences. Using only precise records underestimated loss of suitable habitat and overestimated the amount of suitable habitat in both the present and the future. Including imprecise records also improves estimates of niche breadth and extent of occurrence. An analysis of 44 species of North American Asclepias (Apocynaceae) yielded similar results.
Main conclusions Existing studies examining the effects of spatial imprecision typically compare outcomes based on precise records against the same records with spatial error added to them. However, in real-world cases, analysts possess a mix of precise and imprecise records and must decide whether to retain or discard the latter. Discarding imprecise records can undersample the geographical and environmental distributions of species and lead to mis-estimation of responses to past and future climate change. Our method, for which we provide a software implementation in the enmSdmX
package for R, is simple to use and can help leverage the large number of specimen records that are typically deemed "unusable" because of spatial imprecision in their geolocation.
Owner metadata
- Name: Adam B. Smith
- Login: adamlilith
- Email:
- Kind: user
- Description: Global change clairvoyant working in the ecotone between theory and application
- Website: www.earthSkySea.org
- Location: Missouri, USA
- Twitter: adamkajiya
- Company: Missouri Botanical Garden
- Icon url: https://avatars.githubusercontent.com/u/7577062?u=f7e2a6a085c1d5388eb4e34997a624288f8aaed0&v=4
- Repositories: 7
- Last ynced at: 2023-02-26T08:50:33.127Z
- Profile URL: https://github.com/adamlilith
GitHub Events
Total
- Issues event: 5
- Delete event: 3
- Issue comment event: 7
- Push event: 23
- Pull request event: 17
- Fork event: 1
- Create event: 2
Last Year
- Issues event: 5
- Delete event: 3
- Issue comment event: 7
- Push event: 23
- Pull request event: 17
- Fork event: 1
- Create event: 2
Committers metadata
Last synced: 7 days ago
Total Commits: 241
Total Committers: 2
Avg Commits per committer: 120.5
Development Distribution Score (DDS): 0.39
Commits in past year: 79
Committers in past year: 2
Avg Commits per committer in past year: 39.5
Development Distribution Score (DDS) in past year: 0.19
Name | Commits | |
---|---|---|
Adam B. Smith | a****m@e****g | 147 |
Adam B. Smith | a****h@m****g | 94 |
Committer domains:
- mobot.org: 1
- earthskysea.org: 1
Issue and Pull Request metadata
Last synced: 1 day ago
Total issues: 6
Total pull requests: 46
Average time to close issues: 6 months
Average time to close pull requests: 2 days
Total issue authors: 5
Total pull request authors: 1
Average comments per issue: 1.83
Average comments per pull request: 0.0
Merged pull request: 43
Bot issues: 0
Bot pull requests: 0
Past year issues: 2
Past year pull requests: 11
Past year average time to close issues: 1 day
Past year average time to close pull requests: 9 days
Past year issue authors: 1
Past year pull request authors: 1
Past year average comments per issue: 3.5
Past year average comments per pull request: 0.0
Past year merged pull request: 10
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- ptitle (2)
- ratneshkarjee (1)
- adamlilith (1)
- Rogerio-7 (1)
- rhijmans (1)
Top Pull Request Authors
- adamlilith (46)
Top Issue Labels
Top Pull Request Labels
Package metadata
- Total packages: 1
-
Total downloads:
- cran: 608 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 12
- Total maintainers: 1
cran.r-project.org: enmSdmX
Species Distribution Modeling and Ecological Niche Modeling
- Homepage: https://github.com/adamlilith/enmSdmX
- Documentation: http://cran.r-project.org/web/packages/enmSdmX/enmSdmX.pdf
- Licenses: MIT + file LICENSE
- Latest release: 1.2.12 (published 30 days ago)
- Last Synced: 2025-04-26T13:32:16.418Z (1 day ago)
- Versions: 12
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 608 Last month
-
Rankings:
- Stargazers count: 16.258%
- Average: 28.242%
- Forks count: 28.83%
- Dependent packages count: 29.797%
- Downloads: 30.872%
- Dependent repos count: 35.455%
- Maintainers (1)
Dependencies
- R >= 4.0.0 depends
- MuMIn * imports
- boot * imports
- dismo * imports
- doParallel * imports
- foreach * imports
- gbm * imports
- graphics * imports
- ks * imports
- maxnet * imports
- methods * imports
- mgcv * imports
- omnibus * imports
- parallel * imports
- randomForest * imports
- scales * imports
- sf * imports
- stats * imports
- terra * imports
- utils * imports
- geodata * suggests
- actions/checkout v2 composite
- r-lib/actions/check-r-package v2 composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
- actions/checkout v3 composite
- r-lib/actions/setup-r f57f1301a053485946083d7a45022b278929a78a composite
- R >= 4.0.0 depends
- DT * imports
- MuMIn * imports
- boot * imports
- data.table * imports
- dismo * imports
- doParallel * imports
- foreach * imports
- gbm * imports
- graphics * imports
- ks * imports
- maxnet * imports
- methods * imports
- mgcv * imports
- omnibus * imports
- parallel * imports
- rJava * imports
- ranger * imports
- scales * imports
- sf * imports
- shiny * imports
- statisfactory * imports
- stats * imports
- terra * imports
- utils * imports
- geodata * suggests
Score: 10.323841273138044