Learn R Programming

rfishbase (version 2.1.2)

common_to_sci: common_to_sci

Description

Return a list of scientific names corresponding to given the common name(s).

Usage

common_to_sci(x, Language = NULL, limit = 1000,
  server = getOption("FISHBASE_API", FISHBASE_API))

Arguments

x

a common name or list of common names

Language

a string specifying the language for the common name, e.g. "English"

limit

The maximum number of matches from a single API call (e.g. per species). Function will warn if this needs to be increased, otherwise can be left as is.

server

base URL to the FishBase API (by default). For SeaLifeBase, use https://fishbase.ropensci.org/sealifebase

Value

a character vector of scientific names

Details

If more than one scientific name matches the common name (e.g. "trout"), the function will simply return a list of all matching scientific names. If given more than one common name, the resulting strings of matching scientific names are simply concatenated.

Setting the language used explicitly will decrease the data transferred and speed up the function. The limit default is quite high in this call, as it corresponds to the number of common names that match a given species, including different languages and countries.

See Also

commonnames, species_list, synonyms

Examples

Run this code
# NOT RUN {
common_to_sci(c("Bicolor cleaner wrasse", "humphead parrotfish"), Language="English")
common_to_sci("trout")
common_to_sci(c("trout", "Coho Salmon"))
# }

Run the code above in your browser using DataLab