background.test {ENMTools} | R Documentation |
background.test Conduct a background test (also called a similarity test), as described in Warren et al. 2008. This test can either be run as an asymmetric test (species.1 vs background of species.2) or as a symmetric test (background of species.1 vs background of species.2). For GLM, Bioclim, and Domain models the replicates will be constructed from the background points supplied for each species. For Maxent, the replicates will be constructed from the range rasters stored in the enmtools.species objects.
Description
background.test Conduct a background test (also called a similarity test), as described in Warren et al. 2008. This test can either be run as an asymmetric test (species.1 vs background of species.2) or as a symmetric test (background of species.1 vs background of species.2). For GLM, Bioclim, and Domain models the replicates will be constructed from the background points supplied for each species. For Maxent, the replicates will be constructed from the range rasters stored in the enmtools.species objects.
Usage
background.test(
species.1,
species.2,
env,
type,
f = NULL,
nreps = 99,
test.type = "asymmetric",
nback = 1000,
bg.source = "default",
low.memory = FALSE,
rep.dir = NA,
verbose = FALSE,
clamp = TRUE,
...
)
Arguments
species.1 |
An emtools.species object from which presence points (asymmetric) or background (symmetric) will be sampled. |
species.2 |
An enmtools.species object from which background will be sampled. |
env |
A SpatRaster object containing environmental data |
type |
The type of model to construct, currently accepts "glm", "mx", "bc", "gam", or "dm" |
f |
A function to use for model fitting. Only required for GLM models at the moment. |
nreps |
Number of replicates to perform |
test.type |
Controls whether the background test will be "symmetric" or "asymmetric" |
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 replicates, models for the empirical data, and summary statistics and plots.
Examples
cyreni <- iberolacerta.clade$species$cyreni
monticola <- iberolacerta.clade$species$monticola
cyreni$range <- background.raster.buffer(cyreni$presence.points, 100000, euro.worldclim)
monticola$range <- background.raster.buffer(monticola$presence.points, 100000, euro.worldclim)
background.test(cyreni, monticola, env = euro.worldclim, type = "glm",
f = pres ~ bio1 + bio12, nreps = 10)