Learn R Programming

sdm (version 1.1-8)

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

Description

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

Usage

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

Value

data.frame

Arguments

x

sdmdata object

...

Additional arguments (optional, see details)

Details

Following additional arguments optionally can be used to get a subset of data by specifying the record IDs; or using a query by specifying the name of species, and/or the name of data groups, and/or range of times (if time information are available):

ind: an intiger vector containing the record Ids; sp: a character vector of the name of species grp: a character vector of the group names (e.g., 'test'; if indipendent test is available) time: a vector of times (an appropriate time class or a character that can be converted into a time format)

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

Run this code
if (FALSE) {
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)
}

Run the code above in your browser using DataLab