as.data.frame: Get a data.frame with record id values (rID)

as.data.frameR Documentation

Get a data.frame with record id values (rID)

Description

Converts a sdmdata object to a data.frame. By including additional arguments, it is possible to make a query on the dataset (see details).

Usage

## S4 method for signature 'sdmdata'
as.data.frame(x, ...)

Arguments

x

sdmdata object

...

Additional arguments (optional, see details)

Details

The following additional arguments can optionally be used to get a subset of data by specifying record IDs; or make a query by specifying the name of species, and/or the name of data groups, and/or a range of time period (if time is available in data):

ind: an integer vector with record Ids;

sp: a character vector with the name of species;

grp: a character vector specifying groups of data (e.g., 'test', if independent test data is available)

time: a vector of times (an appropriate time class or a character that can be converted into a time format)

Value

data.frame

Author(s)

Babak Naimi naimi.b@gmail.com

https://www.r-gis.net/

https://www.biogeoinformatics.org/

References

Naimi, B., Araujo, M.B. (2016) sdm: a reproducible and extensible R platform for species distribution modelling, Ecography, 39:368-375, DOI: 10.1111/ecog.01881

Examples

## Not run: 
file <- system.file("external/data.sdd", package="sdm")

d <- read.sdm(file)

d # a sdmdata object

df <- as.data.frame(d)

head(df)

# only the records with rID == c(1,2,3):

as.data.frame(d, ind=1:3)

## End(Not run)



babaknaimi/sdm documentation built on April 4, 2024, 1:45 p.m.