Learn R Programming

icesVocab (version 1.1-2)

findAphia: Find Aphia Code

Description

Look up Aphia code for a given species.

Usage

findAphia(species, latin = FALSE, regex = FALSE, full = FALSE)

Arguments

species
the species name, either in English (default) or Latin.
latin
whether the species name is in Latin.
regex
whether to match the species name as a regular expression.
full
whether to return a data frame with all species columns.

Value

A vector of Aphia codes (default) or a data frame if full is TRUE.

Details

Species name matches are case-insensitive.

See Also

getCodeList can be used to get all Aphia codes; see example on that help page.

icesVocab-package gives an overview of the package.

Examples

Run this code
findAphia("cod")
findAphia("Gadus morhua", latin = TRUE)

# Multiple matches
findAphia(c("cod", "haddock", "saithe"))

# Regular expressions
findAphia("ray", regex = TRUE, full = TRUE)
findAphia("Sebastes", latin = TRUE, regex = TRUE, full = TRUE)

Run the code above in your browser using DataLab