sample_pseudoabsences: Sampling pseudo-absences

View source: R/sample_pseudoabsences.R

sample_pseudoabsencesR Documentation

Sampling pseudo-absences

Description

Samples pseudo-absences from a environmental extent based on euclidean distances to the observations in a environmental PCA

Usage

sample_pseudoabsences(
  Obs,
  predictors,
  spsNames = NULL,
  th = 0.95,
  ras = NULL,
  res = NULL,
  plot = F
)

Arguments

Obs

a n x 3 data.frame class object indicating longitud, latitud and species in the three first columns

predictors

a n x m data.frame class object indicating longitud, latitud and species in the two first columns. The rest of the columns must be the environmental variables from which the PCA will be computed. Alternatively a raster stack with environmental variables or a dudi.pca object. If dudi.pca, res argument must be provided, otherwhise it will be set to 1.

spsNames

a string vector with selected species names to subset Obs. Default NULL will select all species present in the third column of paramteter Obs

th

a numeric threshold to estimate pseudo-absence distances from observations environmental centroid. Default is 0.95

ras

raster or stacked raster with the ecological contrains that will weight pseudo-absence probabilities. Default NULL

res

resolution of the environmental grid. Default NULL means that will be computed automatically.

plot

Boolean to indicate if computed distances is to be plotted

Details

Returns an error if filename does not exist.

Value

List

Examples

## Not run: 
EN = EN_model(env_data, occ_data1, cluster = "env", n.clus = 5)
PseudoA <- sample_pseudoabsences(EN)

## End(Not run)


agarciaEE/NINA documentation built on Jan. 9, 2025, 10:09 a.m.