Skip to contents

This function has additional options compared to the more generic add_offset(), allowing customized options specifically for expert-based ranges as offsets or spatialized polygon information on species occurrences. If even more control is needed, the user is informed of the "bossMaps" package Merow et al. (2017). Some functionalities of that package emulated through the "distance_function" set to "log". This tries to fit a 5-parameter logistic function to estimate the distance from the range (Merow et al. 2017).


  distance_max = Inf,
  family = "poisson",
  presence_prop = 0.9,
  distance_clip = FALSE,
  distance_function = "negexp",
  field_occurrence = "observed",
  fraction = NULL,
  point = FALSE,
  add = TRUE

# S4 method for BiodiversityDistribution,SpatRaster,ANY,logical

# S4 method for BiodiversityDistribution,sf,numeric,character,numeric,logical,character,character,ANY,ANY,logical



distribution() (i.e. BiodiversityDistribution) object.


A sf or SpatRaster object with the range for the target feature.


A numeric threshold on the maximum distance beyond the range that should be considered to have a high likelihood of containing species occurrences (Default: Inf "m"). Can be set to NULL or 0 to indicate that no distance should be calculated.


A character denoting the type of model to which this offset is to be added. By default it assumes a 'poisson' distributed model and as a result the output created by this function will be log-transformed. If however a 'binomial' distribution is chosen, than the output will be `logit` transformed. For integrated models leave at default.


numeric giving the proportion of all records expected to be inside the range. By default this is set to 0.9 indicating that 10% of all records are likely outside the range.


logical as to whether distance should be clipped after the maximum distance (Default: FALSE).


A character specifying the distance function to be used. Available are negative exponential kernels ("negexp", default) and a five parameters logistic curve (code"logcurve") as proposed by Merow et al. 2017.


A numeric or character location of biodiversity point records.


An optional SpatRaster object that is multiplied with digitized raster layer. Can be used to for example to remove or reduce the expected value (Default: NULL).


An optional sf layer with points or logical argument. In the case of the latter the point data is ignored (Default: FALSE).


logical specifying whether new offset is to be added. Setting this parameter to FALSE replaces the current offsets with the new one (Default: TRUE).


Adds a range offset to a distribution object.


The output created by this function creates a SpatRaster to be added to a provided distribution object. Offsets in regression models are likelihood specific as they are added directly to the overall estimate of `y^hat`.

Note that all offsets created by this function are by default log-transformed before export. Background values (e.g. beyond "distance_max") are set to a very small constant (1e-10).


  • Merow, C., Wilson, A.M., Jetz, W., 2017. Integrating occurrence data and expert maps for improved species range predictions. Glob. Ecol. Biogeogr. 26, 243–258.

  • Merow, C., Allen, J.M., Aiello-Lammens, M., Silander, J.A., 2016. Improving niche and range estimates with Maxent and point process models by integrating spatially explicit information. Glob. Ecol. Biogeogr. 25, 1022–1036.

See also


Other offset: add_offset_bias(), add_offset_elevation(), add_offset(), rm_offset()


if (FALSE) {
 # Adds the offset to a distribution object
 distribution(background) |> add_offset_range(species_range)