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

common_to_sci(
  x,
  Language = "English",
  server = getOption("FISHBASE_API", "fishbase"),
  version = get_latest_release(),
  db = default_db()
)

Arguments

x

a common name or list of common names

Language

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

server

can be set to either "fishbase" or "sealifebase" to switch between databases. NOTE: it is usually easier to leave this as NULL and set the source instead using the environmental variable `FISHBASE_API`, e.g. `Sys.setenv(FISHBASE_API="sealifebase")`.

version

a version string for the database, will default to the latest release. see [get_releases()] for details.

db

the

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.

See also

Examples

# \donttest{ common_to_sci(c("Bicolor cleaner wrasse", "humphead parrotfish"), Language="English")
#> Importing /root/.local/share/R/rfishbase/comnames_fb_1904.tsv.bz2 in 50000 line chunks:
#> ...Done! (in 1.083808 mins)
#> Importing /root/.local/share/R/rfishbase/species_fb_1904.tsv.bz2 in 50000 line chunks:
#> ...Done! (in 17.26161 secs)
#> Importing /root/.local/share/R/rfishbase/genera_fb_1904.tsv.bz2 in 50000 line chunks:
#> ...Done! (in 7.739239 secs)
#> Importing /root/.local/share/R/rfishbase/families_fb_1904.tsv.bz2 in 50000 line chunks:
#> ...Done! (in 5.557892 secs)
#> Importing /root/.local/share/R/rfishbase/orders_fb_1904.tsv.bz2 in 50000 line chunks:
#> ...Done! (in 4.308723 secs)
#> Importing /root/.local/share/R/rfishbase/classes_fb_1904.tsv.bz2 in 50000 line chunks:
#> ...Done! (in 0.9431276 secs)
#> Joining, by = c("Subfamily", "GenCode", "FamCode")
#> Joining, by = "FamCode"
#> Joining, by = c("Order", "Ordnum", "Class", "ClassNum")
#> Joining, by = c("Class", "ClassNum")
#> # A tibble: 5 x 4 #> Species ComName Language SpecCode #> <chr> <chr> <chr> <dbl> #> 1 Labroides bicolor Bicolor cleaner wrasse English 5650 #> 2 Chlorurus cyanescens Blue humphead parrotfish English 7909 #> 3 Bolbometopon muricatum Green humphead parrotfish English 5537 #> 4 Bolbometopon muricatum Humphead parrotfish English 5537 #> 5 Chlorurus oedema Uniform humphead parrotfish English 8394
common_to_sci(c("Coho Salmon", "trout"))
#> # A tibble: 306 x 4 #> Species ComName Language SpecCode #> <chr> <chr> <chr> <dbl> #> 1 Oncorhynchus kisutch Coho salmon English 245 #> 2 Salmo obtusirostris Adriatic trout English 6210 #> 3 Schizothorax richardsonii Alawan snowtrout English 8705 #> 4 Schizopyge niger Alghad snowtrout English 24454 #> 5 Salvelinus fontinalis American brook trout English 246 #> 6 Salmo trutta Amu-Darya trout English 238 #> 7 Salmo kottelati Antalya trout English 67602 #> 8 Oncorhynchus apache Apache Trout English 2687 #> 9 Oncorhynchus apache Apache trout English 2687 #> 10 Plectropomus areolatus Apricot trout English 6082 #> # … with 296 more rows
# }