get_accessions: Get accession passport data as a data table.

View source: R/genesys.R

get_accessionsR Documentation

Get accession passport data as a data table.

Description

Get accession passport data as a data table.

Usage

get_accessions(
  filters = list(),
  page = 0,
  size = 1000,
  fields = NULL,
  exclude = 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

exclude

list of field prefixes to exclude from the Genesys response

selector

NULL or a function to "select" variables of interest

at.least

stop fetching when at.least records are received from Genesys

Value

Data table

See Also

mcpd_filter

Examples

## 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 <- genesysr::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 May 29, 2024, 3:42 a.m.