inspect: Get more data on individual occurrences

View source: R/inspect.R

inspectR Documentation

Get more data on individual occurrences

Description

Fetches the complete record, which may or may not be the same as requested through occ(). Some data providers have different ways to retrieve many occurrence records vs. single occurrence records - and sometimes the results are more verbose when retrieving a single occurrence record.

Usage

inspect(x, from = "gbif")

## S3 method for class 'data.frame'
inspect(x, from = "gbif")

## S3 method for class 'occdat'
inspect(x, from = "gbif")

## S3 method for class 'occkey'
inspect(x, from = "gbif")

Arguments

x

The output from occ() call, output from call to occ2df(), or an occurrence ID as a occkey class.

from

(character) The data provider. One of gbif, inat, or vertnet

Value

A list, with each slot named for the data source, and then within data sources is a slot for each taxon, named by it's occurrence ID.

Examples

## Not run: 
spnames <- c('Accipiter striatus', 'Spinus tristis')
out <- occ(query=spnames, from=c('gbif','idigbio'),
   gbifopts=list(hasCoordinate=TRUE), limit=2)
res <- occ2df(out)
inspect(res)

out <- occ(query=spnames, from='gbif', gbifopts=list(hasCoordinate=TRUE),
  limit=4)
res <- occ2df(out)
inspect(res)

# from occkeys
key <- as.gbif(res$key[1])
inspect(key)

# idigbio
spnames <- c('Accipiter striatus', 'Spinus tristis')
out <- occ(query=spnames, from='idigbio', limit=20)
inspect(out)

## End(Not run)

spocc documentation built on March 31, 2023, 9:59 p.m.