get.bydat: Get Fishery data, specify bycatch species

View source: R/get.bydat.r

get.bydatR Documentation

Get Fishery data, specify bycatch species

Description

Function to make dataframe according to bycatch species, fishery etc..

Usage

get.bydat(
  fdat,
  load = T,
  bspec = 366,
  aggfact = "LINK1",
  catch_disp = c(0, 1)[1]
)

Arguments

fdat

name of file to be loaded OR name of variable in workspace containing data

load

should data be loaded into the workspace? If already loaded, specify fdat as the variable name in your workspace and flag load=F

bspec

bycatch species desired

aggfact

aggregation factor. for NOAA data, LINK1 usually indicates trip level. Using eflalo, 'FT_REF' is indicates trips

catch_disp

catch disposition of the bycatch (0 = discard, 1 = kept). Default is 0.

Details

The catch disposition is typically 0 for discards, but some fisheries (herring) may want both.

Value

dataframe of observed catch summed by some aggregating factor (aggfact) for the bycatch species of interest (bspec) and the total catch

Examples

data(eflalo)
dm = make.obs.flag.dat(eflalo, obs_level = .1)
dmo = dm[dm$OBSFLAG==1&dm$FY==1800,]  # one year of data
# Define a bycatch species
bspec = 'LE_KG_BSS' # European seabass (FAO code BSS)
bdat = get.bydat(dmo, aggfact = 'DOCID',load = F, bspec = bspec, catch_disp = 1) # unstratified

noaa-garfo/discaRd documentation built on April 17, 2025, 10:32 p.m.