Learn R Programming

ecospat (version 3.2)

ecospat.rand.pseudoabsences: Sample Pseudo-Absences

Description

Randomly sample pseudoabsences from an environmental dataframe covering the study area.

Usage

ecospat.rand.pseudoabsences (nbabsences, glob, colxyglob, colvar="all", 
presence, colxypresence, mindist)

Arguments

nbabsences

The number of pseudoabsences desired.

glob

A two-column dataframe (or a vector) of the environmental values (in column) for background pixels of the whole study area (in row).

colxyglob

The range of columns for x and y in glob.

colvar

The range of columns for the environmental variables in glob. colvar="all" keeps all the variables in glob in the final dataframe. colvar=NULL keeps only x and y.

presence

A presence-absence dataframe for each species (columns) in each location or grid cell (rows).

colxypresence

The range of columns for x and y in presence.

mindist

The minimum distance from presences within wich pseudoabsences should not be drawn (buffer distance around presences).

Value

A dataframe of random absences.

Examples

Run this code
# NOT RUN {
glob <- ecospat.testData[2:8]
presence <- ecospat.testData[c(2:3,9)]
presence <- presence[presence[,3]==1,1:2]
ecospat.rand.pseudoabsences (nbabsences=10, glob=glob, colxyglob=1:2, colvar = "all", 
presence= presence, colxypresence=1:2, mindist=20)
# }

Run the code above in your browser using DataLab