get_accessions: Fetch accession passport data

Description Usage Arguments Value See Also Examples

View source: R/genesys.R

Description

Fetch accession passport data

Usage

1
2
get_accessions(filters = list(), page = 0, size = 1000,
  fields = NULL, selector = NULL, at.least = NULL)

Arguments

filters

an R structure with Genesys filters

page

the page index (0-based)

size

number of records to load per page (page size)

fields

list of fields to fetch from Genesys

selector

NULL or a function to "select" variables of interest

at.least

stop fetching when at.least records are received from Genesys

Value

Paged data structure

See Also

mcpd_filter

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
  # Retrieve all accession data by country of origin (Slovenia, Ivory Coast)
  accessions <- genesysr::get_accessions(list(countryOfOrigin = list(code3 = c('SVN', 'CIV'))))

  # Fetch Musa, but only geographic data and accessionNumber
  musa <- genesysr::get_accessions(list(taxonomy = list(genus = c('Musa'))),
    fields = c("accessionNumber", "geo"))

  # Apply selector function
  accessions <- get_accessions(mcpd_filter(ORIGCTY = c('DEU', 'SVN')),
    selector = function(x) {
      list(id = x$id, acceNumb = x$accessionNumber, instCode = x$instituteCode)
    }, at.least = 100)

## End(Not run)

genesysr documentation built on Dec. 1, 2019, 1:16 a.m.