Randomly sample pseudoabsences from an environmental dataframe covering the study area.
ecospat.rand.pseudoabsences (nbabsences, glob, colxyglob, colvar="all",
presence, colxypresence, mindist)
A dataframe of random absences.
The number of pseudoabsences desired.
A two-column dataframe (or a vector) of the environmental values (in column) for background pixels of the whole study area (in row).
The range of columns for x and y in glob.
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.
A presence-absence dataframe for each species (columns) in each location or grid cell (rows).
The range of columns for x and y in presence.
The minimum distance from presences within wich pseudoabsences should not be drawn (buffer distance around presences).
Olivier Broennimann olivier.broennimann@unil.ch
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