Learn R Programming

icesVocab (version 1.1-2)

findCode: 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.

Value

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

Details

Matches are case-insensitive.

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

Run this code
findCode("aphia", "cod")

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

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


Run the code above in your browser using DataLab