Added functionextract_static_coords for extractingspatially-buffered co-ordinate data from static datasets.
Added arguments todynamic_proj_covariates() foradding static rasters to covariates for each data (e.g. static elevationraster)
Removed package dependency onraster,sp,geodist andgeosphere.
All functions are nowterra andsfcompatible.
The package has since been published in theOpen Accessjournal “Methods in Ecology and Evolution”
Dobson, R., Challinor, A.J., Cheke, R.A., Jennings, S., Willis,S.G. and Dallimer, M., 2023. dynamicSDM: An R package for speciesgeographical distribution and abundance modelling at high spatiotemporalresolution. Methods in Ecology and Evolution, 14, 1190-1199.
Across ecological research fields, species distribution and abundancemodelling (SDM) is a major tool for understanding the drivers andpatterns of species occurrence. To advance our ability to model speciesinhabiting dynamic ecosystems worldwide,dynamicSDMfacilitates the incorporation of explanatory variables that are dynamicin both space and time. Our functions are:
dynamicSDM functions are split into four key modelling stages:response data, explanatory variables, modelling relationships anddynamic projections. See the package manualherefor more details on each function.
Functions for preparing species distribution or abundance model inputdata for modelling with spatiotemporally dynamic explanatoryvariables.
convert_gbif() Transform Global BiodiversityInformation Facility occurrence records todynamicSDMcompatible.spatiotemp_check() Check species occurrence recordformatting, completeness and validity.spatiotemp_extent() Filter species occurrence recordsby a given spatial and temporal extent.spatiotemp_resolution() Filter species occurrencerecords by given spatial and temporal resolution.spatiotemp_bias() Test for spatial and temporal bias inspecies occurrence records.spatiotemp_thin() Thin species occurrence records byspatial and temporal proximity.spatiotemp_pseudoabs() Generate pseudo-absence recordcoordinates and dates.spatiotemp_weights() Calculate sampling effort acrossspatial and temporal buffer from occurrence records.Functions for extracting spatiotemporally dynamic explanatoryvariable data for species occurrence record co-ordinates and dates usingGoogle Earth Engine.
extract_dynamic_coords() Extract temporally dynamicexplanatory variable data for occurrence records.get_moving_window() Generate a “moving window” matrixof optimal size for spatial buffering of explanatory variable data.extract_buffered_coords() Extract spatially bufferedand temporally dynamic explanatory variable data for occurrencerecords.extract_coords_combine() Combine extracted explanatoryvariable data for occurrence records into single data frame for modelfitting.extract_static_coords Extract spatially buffered datafrom static rasters for occurrence record co-ordinates (no temporaldimension).Functions for generating species distribution or abundance modelsthat account for spatial and temporal autocorrelation in dynamicexplanatory variables.
spatiotemp_autocorr() Test for spatial and temporalautocorrelation in species distribution model explanatory data.spatiotemp_block() Split occurrence records intospatial and temporal blocks for model fitting.brt_fit() Fit boosted regression tree models to speciesdistribution or abundance data.Functions for generating explanatory variable projection data framesat given spatiotemporal extent and resolution, and projecting speciesdynamic distribution and abundance patterns onto these.
dynamic_proj_dates() Generate vector of dates fordynamic projectionsextract_dynamic_raster() Extract temporally dynamicrasters of explanatory variable data.extract_buffered_raster() Extract spatially bufferedand temporally dynamic rasters of explanatory variable data.dynamic_proj_covariates() Combine explanatory variablerasters into a covariate data frame for each projection date.dynamic_proj() Project species distribution andabundance models onto dynamic environmental covariates.dynamic_proj_GIF() Create GIF of dynamic speciesdistribution and abundance projections# Install using Githubinstall_github("r-a-dobson/dynamicSDM")dynamicSDM depends on a range of spatial and graphic R packages,which may result in some persistent errors on installation or running ofcertain functions.
If you encounter an error or bug when installing and usingdynamicSDM, please post a commenthere forguidance and support from us.
Below we have outlined common errors and typical solutions to try,depending on your operating system
# Loading rgl's DLL failed. This build of rgl depends on XQuartz, which failed to load.options(rgl.useNULL =TRUE)library(rgl)On Homebrew (macOS) run:
brew install pkg-configbrew install gdalOn Linux run:
sudo apt-get install libgdal-dev libproj-dev libgeos-dev libudunits2-dev netcdf-binThen in R run:
install.packages("Rcpp")install.packages('terra',repos='https://rspatial.r-universe.dev')On Homebrew (macOS) run:
brew install imagemagick@6On Linux run:
sudo apt-get install -y libmagick++-devThen in R run:
install.packages("magick")