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 /github/home/.local/share/R/rfishbase/comnames_fb_2104.tsv.bz2 in 1000000 line chunks:
#> Rows: 324211 Columns: 35
#> ── Column specification ──────────────────────────────────────────────────────── #> Delimiter: "\t" #> chr (34): autoctr, ComName, Transliteration, StockCode, SpecCode, C_Code, La... #> dbl (1): ComNamesRefNo
#> #> Use `spec()` to retrieve the full column specification for this data. #> Specify the column types or set `show_col_types = FALSE` to quiet this message.
#> ...Done! (in 18.89921 secs)
#> Importing /github/home/.local/share/R/rfishbase/species_fb_2104.tsv.bz2 in 1000000 line chunks:
#> Rows: 35331 Columns: 101
#> ── Column specification ──────────────────────────────────────────────────────── #> Delimiter: "\t" #> chr (63): SpecCode, Genus, Species, Author, FBname, PicPreferredName, PicPre... #> dbl (36): SpeciesRefNo, FamCode, GenCode, SubGenCode, Fresh, Brack, Saltwate... #> lgl (2): AmphibiousRef, Complete
#> #> Use `spec()` to retrieve the full column specification for this data. #> Specify the column types or set `show_col_types = FALSE` to quiet this message.
#> ...Done! (in 4.64563 secs)
#> Importing /github/home/.local/share/R/rfishbase/genera_fb_2104.tsv.bz2 in 1000000 line chunks:
#> Rows: 11863 Columns: 64
#> ── Column specification ──────────────────────────────────────────────────────── #> Delimiter: "\t" #> chr (35): GenCode, GenName, GenAuthorYear, GenAuthor, GenYear, GenInEx, Gen... #> dbl (24): GenRefno, FamCode, DepthRangeShallow, FB_SppNb, CofF_SppNb, FoW_S... #> lgl (2): Brackish, Freshwater #> dttm (3): Dateentered, Datemodified, Datechecked
#> #> Use `spec()` to retrieve the full column specification for this data. #> Specify the column types or set `show_col_types = FALSE` to quiet this message.
#> ...Done! (in 0.7983441 secs)
#> Importing /github/home/.local/share/R/rfishbase/families_fb_2104.tsv.bz2 in 1000000 line chunks:
#> Rows: 1288 Columns: 81
#> ── Column specification ──────────────────────────────────────────────────────── #> Delimiter: "\t" #> chr (50): FamCode, SortID, Family, AuthorYear, Qualification, CommonName, F... #> dbl (23): Species, SexualDimorphism, FossilRef, ValidGenera, Complete, Aspi... #> lgl (5): CAS_LIN, ZooBank_ID, CommonName_Chinese, CommonName_Chinese_u, Co... #> dttm (3): DateEntered, DateModified, DateChecked
#> #> Use `spec()` to retrieve the full column specification for this data. #> Specify the column types or set `show_col_types = FALSE` to quiet this message.
#> ...Done! (in 0.2246912 secs)
#> Importing /github/home/.local/share/R/rfishbase/orders_fb_2104.tsv.bz2 in 1000000 line chunks:
#> Rows: 113 Columns: 56
#> ── Column specification ──────────────────────────────────────────────────────── #> Delimiter: "\t" #> chr (35): Ordnum, Order, Synonym, CommonName, BodyShapeI, Brackish, Freshwa... #> dbl (12): OrderRefNo, SortNo, AuthorYear, Marine, FamCount, ClassNum, ComAn... #> lgl (7): CAS_LIN, ZooBank_ID, DateChecked, CommonName_Spanish, CommonName_... #> dttm (2): DateEntered, DateModified
#> #> Use `spec()` to retrieve the full column specification for this data. #> Specify the column types or set `show_col_types = FALSE` to quiet this message.
#> ...Done! (in 0.08154535 secs)
#> Importing /github/home/.local/share/R/rfishbase/classes_fb_2104.tsv.bz2 in 1000000 line chunks:
#> Rows: 14 Columns: 16
#> ── Column specification ──────────────────────────────────────────────────────── #> Delimiter: "\t" #> chr (7): Class, CommonName, BodyShapeI, WaterSalinity, SuperClass, Subclass,... #> dbl (5): ClassNum, ClassRefNo, SortNo, Synonym, SpeciesCount #> lgl (4): AuthorYear, CAS_LIN, ZooBank_ID, TS
#> #> Use `spec()` to retrieve the full column specification for this data. #> Specify the column types or set `show_col_types = FALSE` to quiet this message.
#> ...Done! (in 0.08971405 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 × 4 #> Species ComName Language SpecCode #> <chr> <chr> <chr> <chr> #> 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: 297 × 4 #> Species ComName Language SpecCode #> <chr> <chr> <chr> <chr> #> 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 287 more rows
# }