Learn R Programming

taxize (version 0.4.0)

get_boldid: Get the BOLD (Barcode of Life) code for a search term.

Description

Get the BOLD (Barcode of Life) code for a search term.

Usage

get_boldid(searchterm, fuzzy = FALSE, dataTypes = "basic",
  includeTree = FALSE, ask = TRUE, verbose = TRUE)

Arguments

searchterm
character; A vector of common or scientific names.
fuzzy
(logical) Whether to use fuzzy search or not (default: FALSE).
dataTypes
(character) Specifies the datatypes that will be returned. See Details for options.
includeTree
(logical) If TRUE (default: FALSE), returns a list containing information for parent taxa as well as the specified taxon.
ask
logical; should get_tsn be run in interactive mode? If TRUE and more than one TSN is found for teh species, the user is asked for input. If FALSE NA is returned for multiple matches.
verbose
logical; should progress be printed?

Value

  • A vector of BOLD ids. If a taxon is not found NA. If more than one BOLD ID is found the function asks for user input (if ask = TRUE), otherwise returns NA. Comes with an attribute match to investigate the reason for NA (either 'not found', 'found' or if ask = FALSE 'multi match')

See Also

get_uid, classification

Examples

Run this code
get_boldid(searchterm = "Agapostemon")
get_boldid(searchterm = "Chironomus riparius")
get_boldid(c("Chironomus riparius","Quercus douglasii")) # needs error catching
splist <- names_list('species')
get_boldid(splist, verbose=FALSE)

# Fuzzy searching
get_boldid(searchterm="Osmi", fuzzy=TRUE)

# When not found
get_boldid("howdy")
get_boldid(c("Chironomus riparius", "howdy"))

Run the code above in your browser using DataLab