sample_envbg | R Documentation |
Generate environmental background data is a function similar to sampleRandom function of the raster package but optimized for Ecological niche modeling.
sample_envbg(
envlayers,
nbg,
nprop = NULL,
coordinates = FALSE,
cellIDs = FALSE,
rseed = NULL,
parallel = TRUE,
ncores = 4
)
envlayers |
A raster stack or brick. |
nbg |
Number of points for the background data |
nprop |
Proportion of environmental data to be sampled. Default NULL |
coordinates |
Logical. If TRUE cell coordinates will be returned |
cellIDs |
Logical. If TRUE cell IDs will be returned |
rseed |
Random seed number. Default NULL |
parallel |
Run the process in parallel |
ncores |
Number of workers to run the parallel process. |
## Not run:
wcpath <- list.files(system.file("extdata/bios",
package = "ntbox"),
pattern = ".tif$",
full.names = TRUE)
envlayers <- raster::stack(wcpath)
vals <- sample_envbg(envlayers,nbg = 3583)
# Using a proportion of data
vals <- sample_envbg(envlayers,nprop = 0.20)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.