findCode: Find a Key

View source: R/findCode.R

findCodeR Documentation

Find a Key

Description

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

Usage

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


findCode("aphia", "cod")

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

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



ices-tools-prod/icesVocab documentation built on Jan. 11, 2024, 1:08 a.m.