get_pesiid: Get the PESI id for a search term.

View source: R/get_pesiid.R

get_pesiidR Documentation

Get the PESI id for a search term.

Description

Retrieve the PESI id of a taxon.

Usage

get_pesiid(
  searchterm,
  searchtype = "scientific",
  accepted = TRUE,
  ask = TRUE,
  verbose = TRUE
)

Arguments

searchterm

character; A vector of common or scientific names.

searchtype

character; One of 'scientific' or 'common', or any unique abbreviation

accepted

logical; If TRUE (default), removes names that are not accepted valid names by PESI. Set to FALSE to give back both accepted and unaccepted names.

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 PESI ids. If a taxon is not found NA is given. If more than one PESI 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

classification_s

Examples

## Not run: 
get_pesiid(searchterm = "Salvelinus")
get_pesiid(c("Salvelinus fontinalis","Pomacentrus brachialis"))
splist <- c("Salvelinus fontinalis", 'Pomacentrus brachialis', "Leptocottus armatus",
  	"Clinocottus recalvus", "Trachurus trachurus", "Harengula clupeola")
get_pesiid(splist, verbose=FALSE)

# When not found
get_pesiid(searchterm="howdy")
get_pesiid(c("Salvelinus fontinalis", "howdy"))

# Using common names
get_pesiid(searchterm="salmon", searchtype="common")
get_pesiid(searchterm="great white shark", searchtype="common")

## End(Not run)

ropensci/taxizesoap documentation built on May 18, 2022, 7:33 p.m.