getGearGroup: Create column for gear called 'geargroup' according to PacFIN...

getGearGroupR Documentation

Create column for gear called geargroup according to PacFIN gears

Description

Data from the PacFIN gear table is used to create a column in Pdata called geargroup, where Pdata$GRID is recoded to geargroup according to the gear table.

Usage

getGearGroup(Pdata, spp = NULL, verbose = TRUE)

Arguments

Pdata

A data frame of biological samples originating from the Pacific Fishieries Information Network (PacFIN) data warehouse, which originated in 2014. Data are pulled using sql calls, see PullBDS.PacFIN().

spp

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.

verbose

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.

Value

A modified data frame where an additional column labeled geargroup is added to Pdata. No original columns are modified in the process.

Author(s)

Andi Stephens

See Also

Reverse dependency of cleanPacFIN

Examples

ex <- getGearGroup(
  data.frame(GRID = c("PRT", "BMT", "FPT")),
  verbose = FALSE
)
table(ex)
testthat::expect_equal(ex[ex[, "geargroup"] == "POT", "GRID"], "FPT")


nwfsc-assess/PacFIN.Utilities documentation built on March 19, 2024, 11:54 p.m.