findCode: Find a Key

Description Usage Arguments Details Value See Also Examples

View source: R/findCode.R

Description

Look up a key for a given code and code type.

Usage

1
findCode(code_type, code, regex = TRUE, full = FALSE)

Arguments

code_type

a search string for a code type, e.g. SpecWorms, or simply worms.

code

a search string for a code, e.g. a species name, cod, or ship name, Clupea.

regex

whether to match as a regular expression.

full

whether to return a data frame.

Details

Matches are case-insensitive.

Value

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

See Also

getCodeList can be used to get all code types; see example on that help page.

icesVocab-package gives an overview of the package.

Examples

1
2
3
4
5
6
7
findCode("aphia", "cod")

# Multiple matches
findCode("aphia", c("cod", "haddock", "saithe"), full = TRUE)

findCodeType("ship", full = TRUE)
findCode("ship", "clupea", full = TRUE)

icesVocab documentation built on Feb. 11, 2022, 1:07 a.m.