View source: R/BackgroundPoints.R
BackgroundPoints | R Documentation |
This function generates a set of species-specific background points using a variety
of methods. These points can be generally across a given training area, or if
environmental data are provided, environmental subsampling (sensu Varela et al. 2014)
can be conducted. If a list of buffers around the occurrence points of each species
are provided, BackgroundPoints
can conduct spatially-constrained sampling
within the buffer (spatial_weights
= 1) or a hybrid method (spatial_weights
between 0 and 1).
BackgroundPoints(
spplist,
envdata,
output,
nbg = 5000,
spatial_weights = 0,
buffers,
method = "Varela",
PCA = "Y",
ncores = 1
)
spplist |
a vector of species names (used for the generation of output file names). |
envdata |
a SpatRaster or list of raster files corresponding to the
area the model will be trained on. If environmental subsampling is desired (method = |
output |
a file folder where the output background point files will be placed. |
nbg |
either a single integer or a vector of the same length as |
spatial_weights |
a number between 0 and 1 determining the percentage of background points sampled within the given buffer. A 1 indicates that background points are exclusively sampled from within the buffers, whereas a 0 indicates random sampling throughout the training area. |
buffers |
(optional) a list of shapefiles (SpatVec) or a list of file paths
for the buffers. Required if |
method |
either "Varela" or "random", where "Varela" incorporates environmental subsampling (see Varela et al. 2014) and "random" simply randomly samples background points. Note that if method = "Varela", exact numbers of background points cannot be guaranteed. |
PCA |
(optional). The number of PC axes to use when binning climate data for environmental
subsampling. Can be a number from 1 to the number of environmental variables. Default selects the
number of axes that account for 95% of the environmental variation. If set to |
ncores |
the number of computer cores to parallelize the background point generation on. Default is 1. Using one fewer core than the computer has is usually optimal. |
writes .csv files of background points for each species in spplist
to a
directory provided by the output
argument. These files have the coordinates of the points and the
environmental values at each point. In addition, if method = "Varela"
, a .csv file is written
out with the number of background points generated for each species, as the exact number of
points may vary.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.