six areas are available to query from bs = bering sea + northwest 1987-present (includes nw stations) - recommended bsslope = bering sea slope nbs = northern bering sea ai = aleutian islands goa = gulf of alaska old_bs = bering sea standard 1982-present (minus ~20 stations in nw) - not recommended

q_gap_biomass(
  year = 2024,
  species = 10110,
  area = "bs",
  type = "region",
  db,
  print_sql = FALSE,
  save = TRUE
)

Arguments

year

max year to retrieve data from, and default folder location

species

5 digit afsc species code(s) e.g., 79210 or c(79210, 90210)

area

options are bs (the bs+nw), bsslope, nbs, ai, goa, old_bs (was called "standard") - can only call a single area

type

the goa and ai have: region, regulatory_area, stat_area, stratum, inpfc, inpfc_depth, depth, (ai only: reg_area_depth); the bs has: region, subarea, stratum, depth; the bsslope has: region, subarea, stratum; the nbs hasregion, stratum - can only use a single type (default: "region")

db

the database to query (akfin)

print_sql

outputs the sql query instead of calling the data (default: false)

save

save the file in designated folder, if FALSE outputs to global environment

Value

saves bts biomass data as data/raw/(area)_(type)_bts_biomass_data.csv or outputs to the global environment, also saves a copy of the SQL code used for the query and stores it in the data/sql folder.

Examples

if (FALSE) {
db <- afscdata::connect()
q_bts_biomass(year=2024, species=10110, area="bs", type="region", db=db)
}