dsmextra provides a toolkit for quantifying and visualising extrapolation in spatially-explicit ecological models (with a focus on density surface models, as implemented in package dsm) projected into novel environmental space. Currently, dsmextra defines extrapolation on the basis of two metrics: (1) ExDet (Mesgaran et al. 2014), and (2) %N (the percentage of data nearby, King & Zeng 2007).

dsmextra offers a variety of numerical and graphical outputs, including summary plots and interactive maps created as ggplot2 and html objects, respectively. Additional functionality (e.g. assessment methods for dynamic covariates) will be added in future releases.

The idea behind dsmextra is to aid ecologists, practitioners, and model end-users in identifying conditions (e.g. areas) under which predicted density surfaces may be prone to errors. In so doing, dsmextra may support:

  • Better-informed interpretations of (density surface) model outputs and their associated uncertainties.
  • Improvements to model development and covariate selection protocols.
  • Cost-effective allocation of future survey effort towards priority, data-poor areas.

Getting started

If you are just getting started with dsmextra, we recommend reading the introductory (‘Get started’) tutorial vignette, which provides a quick introduction to the package. You may also find the below paper and technical report useful:

Additional reading

  • Mannocci et al. (2018). Assessing cetacean surveys throughout the mediterranean sea: A gap analysis in environmental space. Scientific Reports 8, art3126. DOI: 10.1038/s41598-018-19842-9.

  • Mannocci et al. (2017). Extrapolating cetacean densities to quantitatively assess human impacts on populations in the high seas. Conservation Biology 31, 601–614. DOI: 10.1111/cobi.12856.

  • Mesgaran et al. (2014). Here be dragons: A tool for quantifying novelty due to covariate range and correlation change when projecting species distribution models. Diversity and Distributions 20, 1147–1159. DOI: 10.1111/ddi.12209.

  • Miller et al. (2013). Spatial models for distance sampling data: Recent developments and future directions. Methods in Ecology and Evolution 4, 1001–1010. DOI: 10.1111/2041-210X.12105.

  • King G & Zeng L (2007). When can history be our guide? The pitfalls of counterfactual inference. International Studies Quarterly 51, 183–210. DOI: 10.1111/j.1468-2478.2007.00445.x.


This R package was developed for the DenMod project (Working group for the advancement of marine species density surface modelling), and was funded by OPNAV N45 and the SURTASS LFA Settlement Agreement, being managed by the U.S. Navy’s Living Marine Resources program under Contract No. N39430-17-C-1982. The sperm whale data showcased in the online vignette were provided by Debi Palka (NOAA North East Fisheries Science Center) and Lance Garrison (NOAA South East Fisheries Science Center). Initial data processing was undertaken by Jason Roberts (Marine Geospatial Ecology Lab, Duke University).


The latest development version can be installed from Github (requires the remotes package):

if (!require("remotes")) install.packages("remotes")

Found a bug? Have a feature request?

Please submit an issue or send a pull request to the Github repository.