Skip to contents

This function adds constrain as defined by the MigClimto approach (Engler et al. 2013) to a BiodiversityScenario object to constrain future projections. For a detailed description of MigClim, please the respective reference and the UserGuide. The default parameters chosen here are suggestions.


# S4 method for BiodiversityScenario, character, numeric, numeric, character, numeric, numeric, numeric, numeric, numeric, character
add_constrain_MigClim(mod, rcThresholdMode, dispSteps, dispKernel, barrierType, lddFreq, lddRange, iniMatAge, propaguleProdProb, replicateNb, dtmp)



A BiodiversityScenario object with specified predictors.


A character of either binary or continuous value. Default: continuous


numeric parameters on the number of dispersal steps. Dispersal steps are executed for each timestep (prediction layer) and ideally should be aligned with the number of steps for projection. Minimum is 1 (Default) and maximum is 99.


A vector with the number of the dispersal Kernel to be applied. Can be set either to a uniform numeric vector, e.g. c(1,1,1,1) or to a proportional decline (1,0.4,0.16,0.06,0.03) (Default) Depending on the resolution of the raster, this parameter needs to be adapted


A character indicating whether any set barrier should be set as 'strong' or 'weak' barriers. Strong barriers prevent any dispersal across the barrier and weak barriers only do so if the whole dispKernel length is covered by the barrier (Default: 'strong').


numeric parameter indicating the frequency of long-distance dispersal (LDD) events. Default is 0, so no long-distance dispersal.


A numeric value highlighting the minimum and maximum distance of LDD events. Note: The units for those distance are in cells, thus the projection units in the raster.


Initial maturity age. Used together with propaguleProd as a proxy of population growth. Must be set to the cell age in time units which are dispersal steps (Default: 1).


Number of replicates to be used for the analysis (Default: 10).


A character to a folder where temporary files are to be created.


Probability of a source cell to produce propagules as a function of time since colonization. Set as probability vector that defines the probability of a cell producing propagules.


Adds a MigClim onstrain to a BiodiversityScenario object.


The barrier parameter is defined through add_barrier.


  • Engler R., Hordijk W. and Guisan A. The MIGCLIM R package – seamless integration of dispersal constraints into projections of species distribution models. Ecography,

  • Robin Engler, Wim Hordijk and Loic Pellissier (2013). MigClim: Implementing dispersal into species distribution models. R package version 1.6.

See also



if (FALSE) {
# Assumes that a trained 'model' object exists
 mod <- scenario(model) |>
  add_predictors(env = predictors, transform = 'scale', derivates = "none") |>
  add_constrain_MigClim() |>