sp_spp: Gather species lists for each data source

Description Usage Examples

View source: R/sp_spp.R

Description

Gather species lists for each data source

Usage

1
sp_spp(x)

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: 
# occurrence data
library(spocc)
geom <- 'POLYGON((-124.07 41.48,-119.99 41.48,-119.99 35.57,-124.07 35.57,-124.07 41.48))'
res <- occ(geometry = geom, from = "gbif", limit = 15)

# pass output of `spocc::occ()`, an `occdat` object
res
spp <- sp_spp(res)
spp
attr(spp$gbif, "spp")
attr(spp$idigbio, "spp")

# pass one data source from output of `spocc::occ()`, an `occdatind` object
res$gbif
z <- sp_spp(res$gbif)
z
attr(z, "spp")

# multiple names and multiple sources in `occ()` query param
taxa <- c('Pinus contorta', 'Accipiter striatus')
res <- occ(query=taxa, from = c("gbif", "idigbio"), limit = 15)
res
z <- sp_spp(res)
z$gbif
z$idigbio
lapply(z$idigbio$data, attr, which = "spp")
lapply(z$gbif$data, attr, which = "spp")

## End(Not run)

ropenscilabs/spplit documentation built on Sept. 29, 2020, 3:05 a.m.