spocc (version 1.1.0)

as.inat: Coerce occurrence keys to iNaturalist id objects

Description

Coerce occurrence keys to iNaturalist id objects

Usage

as.inat(x, ...)

Arguments

x

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

...

curl options; named parameters passed on to crul::HttpClient()

Value

One or more in a list of both class inatkey and occkey

See Also

Other coercion: as.ala(), as.bison(), as.ecoengine(), as.gbif(), as.idigbio(), as.obis(), as.vertnet()

Examples

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

Run the code above in your browser using DataCamp Workspace