get_fleet: translate between fleet names and numbers and old or new

View source: R/get_fleet.R

get_fleetR Documentation

translate between fleet names and numbers and old or new

Description

uses models/fleets.csv as a lookup table to translate between different combinations

Usage

get_fleet(value = NULL, yr = 2021, area = NULL, ignore.case = TRUE, col = NULL)

Arguments

value

either a fleet number or a string matching the fleet name a NULL value will return the full table of all fleet info for the associated year (separate TRI_Early and TRI_Late will be returned with yr = 2019, not yr = 2019). a vector of numeric values will return a vector

yr

year (assumed 2021 if not specified)

area

either "n" or "s"

ignore.case

if FALSE, the pattern matching is case sensitive and if TRUE, case is ignored during matching (passed to grep)

col

column(s) to return. NULL will return all columns.

Author(s)

Ian G. Taylor

Examples

  # current fleet number for trawl using "col" input added 3-June-2021
  get_fleet("trawl", col = "num")

  # current fleet number for trawl before "col" input was available
  get_fleet("trawl")$num

  # plain text label associated with fleet 3
  get_fleet(3, col = "label_short")

  # current fleet number that corresponds to an old fleet name
  get_fleet("TRI_Early", area = "s", yr = 2019, col = "num")

  # current fleet number that corresponds to an old fleet number
  get_fleet(4, area = "s", yr = 2019, col = "num")

  # current fleet number that corresponds to a vector of old fleet numbers
  get_fleet(value = c(1,2,2,3), yr = 2019, area = 's', col = "num")

  # info on all current rec fleets
  get_fleet("rec")

  # info on all fleets in 2021 models (excludes duplicates)
  get_fleet()

  # info on all fleets in 2019 models
  # (includes separate rows for TRI_Early and TRI_Late)
  get_fleet(yr = 2019)

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