Learn R Programming

spocc (version 0.4.5)

as.idigbio: Coerce occurrence keys to idigbio uuid objects

Description

Coerce occurrence keys to idigbio uuid objects

Usage

as.idigbio(x)

Arguments

x
Various inputs, including the output from a call to occ (class occdat), occ2df (class data.frame), or a list, numeric, character, idigbiokey, or occkey.

Value

  • One or more in a list of both class idigbiokey and occkey

Details

Internally, we use idig_view_records, whereas we use idig_search_records in the occ function.

Examples

Run this code
spnames <- c('Accipiter striatus', 'Setophaga caerulescens', 'Carduelis tristis')
out <- occ(query=spnames, from='idigbio', limit=2)
res <- occ2df(out)
(tt <- as.idigbio(out))
(uu <- as.idigbio(res))
as.idigbio(res$key[1])
as.idigbio(as.list(res$key[1:2]))
as.idigbio(tt[[1]])
as.idigbio(uu[[1]])
as.idigbio(tt[1:2])

library("dplyr")
rbind_all(lapply(tt, function(x) data.frame(unclass(x)$data)))

Run the code above in your browser using DataLab