Skip to contents

Coerce occurrence keys to vertnetkey/occkey objects

Usage

as.vertnet(x)

Arguments

x

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

Value

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

Details

Internally, we use rvertnet::vert_id(), whereas occ() uses rvertnet::vertsearch().

See also

Other coercion: as.ala(), as.gbif(), as.idigbio(), as.inat(), as.obis()

Examples

if (FALSE) { # \dontrun{
# spnames <- c('Accipiter striatus', 'Setophaga caerulescens',
#   'Spinus tristis')
# out <- occ(query=spnames, from='vertnet', has_coords=TRUE, limit=2)
# res <- occ2df(out)
# (tt <- as.vertnet(out))
# (uu <- as.vertnet(res))
# keys <- Filter(Negate(is.na), res$key)
# as.vertnet(keys[1])
# as.vertnet(as.list(keys[1:2]))
# as.vertnet(tt[[1]])
# as.vertnet(uu[[1]])
# as.vertnet(tt[1:2])
} # }