rangebreak.ribbon {ENMTools}R Documentation

rangebreak.ribbon Conduct a ribbon rangebreak test as described in Glor and Warren 2011.

Description

rangebreak.ribbon Conduct a ribbon rangebreak test as described in Glor and Warren 2011.

Usage

rangebreak.ribbon(
  species.1,
  species.2,
  ribbon,
  env,
  type,
  f = NULL,
  width = 1,
  nreps = 99,
  nback = 1000,
  bg.source = "default",
  low.memory = FALSE,
  rep.dir = NA,
  verbose = FALSE,
  clamp = TRUE,
  ...
)

Arguments

species.1

An emtools.species object

species.2

An enmtools.species object

ribbon

An enmtools.species object representing the region of marginal habtiat in the overlap between the species' ranges

env

A SpatRaster object containing environmental data

type

The type of model to construct, currently accepts "glm", "mx", "bc", or "dm"

f

A function to use for model fitting. Only required for GLM models at the moment.

width

Width of the ribbon, in the same units as the occurrence points (e.g, decimal degrees)

nreps

Number of replicates to perform

nback

Number of background points for models

bg.source

Source for drawing background points. If "points", it just uses the background points that are already in the species object. If "range", it uses the range raster. If "env", it draws points at randome from the entire study area outlined by the first environmental layer.

low.memory

When set to TRUE, replicate models are written to disc instead of being stored in the output object. Replicate models stored in the output object contain paths to the replicate models on disk instead of the rasters themselves.

rep.dir

Directory for storing replicate models when low.memory is set to TRUE. If not specified, the working directory will be used.

verbose

Controls printing of various messages progress reports. Defaults to FALSE.

clamp

Controls whether empirical and replicate models should be clamped to the environment space used for training.

...

Additional arguments to be passed to model fitting functions.

Value

results A list containing models for the replicates, models for the empirical data, and summary statistics and plots.

Examples


cyreni <- iberolacerta.clade$species$cyreni
aranica <- iberolacerta.clade$species$aranica

# We're just going to fudge together occurrence data from a ribbon here
# from random points between the two species' ranges
p <- data.frame(x = runif(50, -4, -2), y = runif(50, 40, 43))
p <- terra::vect(p, geom = c("x", "y"), crs = terra::crs(cyreni$presence.points))
bg <- background.buffer(p, 100000, mask = euro.worldclim[[1]], n = 100, return.type = "points")
ribbon <- enmtools.species(species.name = "ribbon", presence.points = p, background.points = bg)

rangebreak.ribbon(cyreni, aranica, ribbon = ribbon, env = euro.worldclim,
type = "glm", f= pres ~ bio1 + bio12, nreps = 10)


[Package ENMTools version 1.1.2 Index]