use_fleetabb: Get fleet abbreviation based on gear group

View source: R/use_fleetabb.R

use_fleetabbR Documentation

Get fleet abbreviation based on gear group

Description

Get the fleet, i.e., "TW" or "FG", depending on matching the pattern to the values in x.

Usage

use_fleetabb(x, pattern = "^TW|^DRG|NET", use = c("TW", "FG"))

Arguments

x

A vector of character values.

pattern

A regular expression to search for.

use

A vector of two character values, where the first value will be used for all values in x that match pattern and the second will be used for those that do not match. The default are for trawl and fixed gear abbreviations.

Value

A vector of "TW" or "FG" depending on if the values in x match the pattern, respectively. If you change the default values in use, then the output will be different but still one value for TRUE and another for all FALSE grepl.

Author(s)

Kelli Faye Johnson

Examples

use_fleetabb(c("HKL", "TWL", "POT"))

iantaylor-NOAA/Lingcod_2021 documentation built on Oct. 30, 2024, 6:42 p.m.