get_wormsid: Get the WoRMS id for a search term.

View source: R/get_wormsid.R

get_wormsidR Documentation

Get the WoRMS id for a search term.

Description

Retrieve the WoRMS id of a taxon.

Usage

get_wormsid(
  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 WoRMS. 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 WoRMS ids. If a taxon is not found NA is given. If more than one WoRMS 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_wormsid(searchterm = "Salvelinus fontinalis")
get_wormsid(c("Salvelinus fontinalis","Pomacentrus brachialis"))
splist <- c("Salvelinus fontinalis", 'Pomacentrus brachialis', "Leptocottus armatus",
		"Clinocottus recalvus", "Trachurus trachurus", "Harengula clupeola")
get_wormsid(splist, verbose=FALSE)

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

# Using common names
get_wormsid(searchterm="salmon", searchtype="common")

## End(Not run)

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