dynamicSDM

License Codecov test coverage R-CMD-check DOI CRAN status

Added features dynamicSDM v1.3

Dobson, R., Challinor, A.J., Cheke, R.A., Jennings, S., Willis, S.G. and Dallimer, M., 2023. dynamicSDM: An R package for species geographical distribution and abundance modelling at high spatiotemporal resolution. Methods in Ecology and Evolution, 14, 1190-1199.

Summary

Across ecological research fields, species distribution and abundance modelling (SDM) is a major tool for understanding the drivers and patterns of species occurrence. To advance our ability to model species inhabiting dynamic ecosystems worldwide, dynamicSDM facilitates the incorporation of explanatory variables that are dynamic in both space and time. Our functions are:

Package structure

dynamicSDM functions are split into four key modelling stages: response data, explanatory variables, modelling relationships and dynamic projections. See the package manual here for more details on each function.

1) Response data functions

Functions for preparing species distribution or abundance model input data for modelling with spatiotemporally dynamic explanatory variables.

2) Explanatory variable functions

Functions for extracting spatiotemporally dynamic explanatory variable data for species occurrence record co-ordinates and dates using Google Earth Engine.

3) Modelling relationship functions

Functions for generating species distribution or abundance models that account for spatial and temporal autocorrelation in dynamic explanatory variables.

4) Dynamic projection functions

Functions for generating explanatory variable projection data frames at given spatiotemporal extent and resolution, and projecting species dynamic distribution and abundance patterns onto these.

Installation

# Install using Github 
install_github("r-a-dobson/dynamicSDM")

Common installation errors

dynamicSDM depends on a range of spatial and graphic R packages, which may result in some persistent errors on installation or running of certain functions.

If you encounter an error or bug when installing and using dynamicSDM, please post a comment here for guidance and support from us.

Below we have outlined common errors and typical solutions to try, depending on your operating system

1) Error with rgl

# Loading rgl's DLL failed. This build of rgl depends on XQuartz, which failed to load.
options(rgl.useNULL = TRUE)
library(rgl)

2) Dependency package terra

On Homebrew (macOS) run:

brew install pkg-config
brew install gdal

On Linux run:

sudo apt-get install libgdal-dev libproj-dev libgeos-dev libudunits2-dev netcdf-bin 

Then in R run:

install.packages("Rcpp")
install.packages('terra', repos='https://rspatial.r-universe.dev')

3) Dependency package magick

On Homebrew (macOS) run:

 brew install imagemagick@6

On Linux run:

sudo apt-get install -y libmagick++-dev

Then in R run:

install.packages("magick")