geargroup according to PacFIN gearsgetGearGroup.RdCreate column for gear called geargroup according to PacFIN gears
getGearGroup(Pdata, keep_gears = NULL, spp = NULL, verbose = TRUE)A data frame, typically one extracted from PacFIN but for this
function just one column is needed, PACFIN_GEAR_CODE.
A character vector including the gear types you want
to label as unique fleets. Order matters and will define fleet numbering.
If the argument is missing, which is the default, then all found gear
groups are maintained and ordered alphabetically. For more details see
getGearGroup(), which lists a link where you can find the available gear
groupings and how they link to "PACFIN_GEAR_CODE" within your data. The vector
supplied to this argument should consist of only options available in
unique(GearTable[["GROUP"]]).
Typical entries will include character values
such as HKL, POT, TWL, where the latter is short for all non-shrimp
trawls and TWS is shrimp trawls. Other gear identification codes and
their definitions include DRG which is dredge gear, MSC which is all
other miscellaneous gear such as diving or river trawls, NET which is all
non-trawl net gear, NTW which is non-trawl gear, and TLS which is
trolling gear. As a special case, MID is available for spiny dogfish to
extract mid-water trawl data as a separate fleet.
A character string giving the species name to ensure that the
methods are species specific. Leave NULL if generic methods work for
your species. Currently, sablefish is the only species with
species-specific code.
A logical specifying if output should be written to the
screen or not. Good for testing and exploring your data but can be turned
off when output indicates information that you already know. The printing
of output to the screen does not affect any of the returned objects. The
default is to always print to the screen, i.e., verbose = TRUE.
A modified data frame where an additional column labeled geargroup is
added to Pdata. No original columns are modified in the process.
Data from the PacFIN gear table
is used to create a column in Pdata called geargroup, where
Pdata[["PACFIN_GEAR_CODE"]] is recoded to geargroup according to the gear group listed
in the table.
For some species the recoding is more intense. For example, sablefish
GROUPS are recoded into just three gears, hook and line (HKL), pot (POT),
and trawl (TWL). This is done internally to maintain consistency across
assessment authors. Other species can easily be added to this function. If a
species name is not passed then no additional recoding is performed compared
to the matching available in the table pulled from online.
cleanPacFIN() uses this function
gears <- c("PRT", "FPT", "TWL", "MDP")
X <- getGearGroup(data.frame(PACFIN_GEAR_CODE = gears), verbose = TRUE)
#> `getGearGroup()` summary information -
#> ℹ geargroup includes: MDP (1), POT (1), and TWL (2)
#> ℹ The following gears were not included in keep_gears and will be removed if
#> clean = TRUE: MDP (1), POT (1), and TWL (2).