SDMtab: Compile species distribution dataset for modelling

View source: R/SDMtab.R

SDMtabR Documentation

Compile species distribution dataset for modelling

Description

Create a dataframe that contains the required information to implement species distribution models

Usage

SDMtab(xydata, predictors, unique.data = TRUE, same = TRUE,
     background.nb=NULL, KDE_layer=NULL)

Arguments

xydata

Dataframe with longitude (column 1) and latitude (column 2) of the presence-only data. Decimal longitude and latitude are required.

predictors

Rasterstack of environmental descriptors. Used to extract values of the presence location

unique.data

If TRUE (by default), duplicate presence points, that fall in the same grid cell, will be removed

same

If TRUE (by default), the number of background data sampled in the area equals the number of presence data

background.nb

Set as NULL if same= TRUE.

KDE_layer

Rasterlayer that describes the frequency of visits in the area (i.e. the spatial bias that could be present in the occurrence dataset)

Details

Background data are sampled randomly (without replacement) among the entire area, on pixels that are not assigned NA. It constitutes a summary of environmental descriptors to improve modelling performance. See Barbet Massin et al. (2012) for further information about background selection.

Value

A dataframe that contains the id (1 for presence, 0 for background data) of data, their longitude, latitude and extracted values of environmental descriptors at the corresponding locations.

xydata for which coordinates fall out of the RasterStack extent are removed from the analysis.

References

Barbet Massin M, F Jiguet, C Albert & W Thuiller (2012) Selecting pseudo absences for species distribution models: how, where and how many? Methods in Ecology and Evolution, 3(2): 327-338.

See Also

delim.area to refine the environmental RasterStack before using this function

Examples

#Open occurrence data
data('ctenocidaris.nutrix')
occ <- ctenocidaris.nutrix

#Open environmental descriptors RasterStack
data(predictors2005_2012)
envi <- predictors2005_2012
envi

#create the dataframe for modelling
z <- SDMPlay:::SDMtab(xydata=occ[,c('decimal.Longitude','decimal.Latitude')],predictors=envi)
head(z)


charleneguillaumot/SDMPlay documentation built on Feb. 2, 2023, 1:09 p.m.