occ2df: Combine results from occ calls to a single data.frame

Description Usage Arguments Details Examples

Description

Combine results from occ calls to a single data.frame

Usage

1
occ2df(obj, what = "data")

Arguments

obj

Input from occ, an object of class occdat, or an object of class occdatind, the individual objects from each source within the occdat class.

what

(character) One of data (default) or all (with metadata)

Details

This function combines a subset of data from each data provider to a single data.frame, or metadata plus data if you request what="all". The single data.frame contains the following columns:

  • name - scientific (or common) name

  • longitude - decimal degree longitude

  • latitude - decimal degree latitude

  • prov - data provider

  • date - occurrence record date

  • key - occurrence record key

AntWeb doesn't provide dates, so occurrence rows from that provider are blank.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
## Not run: 
# combine results from output of an occ() call
spnames <- c('Accipiter striatus', 'Setophaga caerulescens',
  'Spinus tristis')
out <- occ(query=spnames, from='gbif', gbifopts=list(hasCoordinate=TRUE),
  limit=10)
occ2df(out)
occ2df(out$gbif)

out <- occ(
  query='Accipiter striatus',
  from=c('gbif','bison','ecoengine','ebird','inat','vertnet'),
  gbifopts=list(hasCoordinate=TRUE), limit=2)
occ2df(out)
occ2df(out$vertnet)

# or combine many results from a single data source
spnames <- c('Accipiter striatus', 'Spinus tristis')
out <- occ(query=spnames, from='ecoengine', limit=2)
occ2df(out$ecoengine)

spnames <- c('Accipiter striatus', 'Spinus tristis')
out <- occ(query=spnames, from='gbif', limit=2)
occ2df(out$gbif)

spp <- c("Linepithema humile", "Crematogaster brasiliensis")
out <- occ(query=spp, from='antweb', limit=2)
occ2df(out$antweb)

## End(Not run)


Search within the spocc package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.