SDMconnect

SDMconnect

SDMconnect is an R package for raster-based connectivity analysis using Species Distribution Models (SDMs) as inputs. It is designed for workflows where habitat suitability maps are converted into spatial questions about landscape connectivity, cost-distance, and the potential isolation of suitable habitat under environmental change.

The package requires either a resistance or permeability surface for cost-based path analysis. These surfaces represent how difficult or easy it is for organisms to move through the landscape matrix, allowing SDM outputs to be linked with functional connectivity metrics.

Main functionality

  • Use SDM raster outputs as source and target layers for connectivity analysis.
  • Analyse cost-based paths through resistance or permeability surfaces.
  • Calculate k-shortest path distances between source cells and multiple target cells.
  • Estimate average cost distance from source cells to target cells located in distinct nearby habitat clumps.
  • Calculate overlap among shortest paths connecting source and target cells.
  • Generate SDM change maps representing unsuitable, gained, lost, and stable suitable areas.
  • Create source-target matrices for sampling route connections between habitat-change classes.
  • Work with simulated test data to demonstrate and validate analysis workflows.

Connectivity workflow

SDMconnect implements the approach proposed by Goncalves et al. (2016) for assessing vulnerability to landscape fragmentation under environmental change. The workflow uses SDM predictions from two time periods to identify areas of habitat loss, habitat gain, stable suitable habitat, and stable unsuitable habitat. Connectivity analyses can then be run from source cells, such as projected habitat-loss areas, to target cells, such as nearby stable suitable habitat clumps.

This makes the package useful for studies that need to combine species distribution modelling with functional connectivity analysis, especially for low-dispersal species and fragmented landscapes where the configuration of suitable habitat can strongly affect persistence.

Example analyses

The README demonstrates a k-shortest path distance analysis using simulated SDM rasters and a resistance layer:

library(SDMconnect)
library(rasterVis)

testData <- generateTestData(nrow = 50, ncol = 50)

sdm1 <- testData$rstbin1
sdm2 <- testData$rstbin2
costLayer <- testData$costLayer

kspDist <- kShortestPathDistance(
  sdm1,
  sdm2,
  costLayer = costLayer,
  costLayerType = "resistance",
  k = 5,
  fromCellsType = "loss",
  toCellsType = "suitable",
  clumpDirs = 4
)

The package also includes functions for deriving SDM change maps, plotting source-target matrices, and estimating overlap among shortest paths:

changeMap <- sdmChangeMap(sdm1, sdm2)

kspOv <- kShortestPathOverlap(
  sdm1,
  sdm2,
  costLayer = costLayer,
  costLayerType = "resistance",
  k = 5,
  fromCellsType = "loss",
  toCellsType = "suitable",
  clumpDirs = 4
)

Installation

SDMconnect can be installed from GitHub with devtools:

if (!("devtools" %in% rownames(installed.packages()))) {
  install.packages("devtools")
}

devtools::install_github("joaofgoncalves/SDMconnect")

Some functionality depends on Java through rJava, particularly the LORACS multiple-shortest path approach. For this workflow, R and Java architectures must match, and a suitable Java Development Kit installation is required.

Reference

Goncalves, J., Honrado, J.P., Vicente, J.R., & Civantos, E. (2016). A model-based framework for assessing the vulnerability of low dispersal vertebrates to landscape fragmentation under environmental change. Ecological Complexity, 28, 174-186. ScienceDirect

Repository

GitHub - joaofgoncalves/SDMconnect

comments powered by Disqus