sampleBackground: Select background cells

View source: R/sampleBackground.R

sampleBackgroundR Documentation

Select background cells

Description

Select a set of background cells from a base raster layer

Usage

sampleBackground(
  occData,
  baseRaster,
  boundsPolygon,
  nBkgSamples = maxBkgSamples,
  maxBkgSamples = 10000,
  trace = FALSE
)

Arguments

occData

a data frame or matrix with at least two numeric columns which can be associated with longitude (or X) and latitude (or Y)

baseRaster

A raster layer object representing the geometry of the environmental data layers to be used for modelling

boundsPolygon

An sf or SpatialPolygons* object defining the boundary within which background points must be selected

nBkgSamples

Numeric. The number of samples to constitute the background set with the default = maxBkgSamples

maxBkgSamples

Numeric. Maximum number of background samples to be generated (default = 10,000)

trace

Logical. Emits additional diagnostic messages when TRUE; default is FALSE

Details

The number of background samples may need to be adjusted to suit particular situations.

The default value for maxBkgSamples matches the value used in the original MaxEnt Java implementation (see Phillips, S. J., and M. Dudík. 2008. Modeling of species distributions with Maxent: new extensions and a comprehensive evaluation. Ecography 31:161–175. for the reason it was selected).

For many taxa, sampling a constrained area means that less than 10,000 cells will be available. When this occurs, the user is warned and the number of background samples returned is the maximum physically available within the specified buffer.

Value

A integer array of indices to selected background cells on the base raster


peterbat1/fitMaxnet documentation built on Sept. 17, 2024, 10:50 p.m.