Learn R Programming

taxize (version 0.0.2)

get_tsn: Get the TSN code for a search term.

Description

get_tsn uses a variety of functions from the ritis package: https://github.com/ropensci/ritis.

Usage

get_tsn(searchterm, searchtype = "sciname",
    verbose = TRUE)

Arguments

searchterm
A vector of common or scientific names.
searchtype
One of 'sciname', 'anymatch', 'comnamebeg', 'comname', 'comnameend'.
verbose
should progress be printed?

Value

  • A vector of taxonomic serial numbers (TSN). If a species is not found NA. If more than one TSN is found the function asks for user input. See functions in ritis.

Examples

Run this code
get_tsn("Quercus douglasii", "sciname")
get_tsn(searchterm="Chironomus riparius", searchtype="sciname")
get_tsn(searchterm="polar bear", searchtype="comname")
get_tsn(c("Chironomus riparius","Quercus douglasii"), "sciname")
get_tsn(c("aa aa", "Chironomus riparius"), searchtype="sciname")
splist <- c("annona cherimola", 'annona muricata', "quercus robur",
"shorea robusta", "pandanus patina", "oryza sativa", "durio zibethinus")
get_tsn(splist,"sciname")

Run the code above in your browser using DataLab