get_weighted_current: get_weighted_current

View source: R/get_weighted_current.r

get_weighted_currentR Documentation

get_weighted_current

Description

Calculate current weight-at-age for landings and discards. This is code from the Beaufort Assessment Model converted from ADMB to R.

Usage

get_weighted_current(
  rdat,
  selpar_n_yrs_wgted = 3,
  duplicate_sel = data.frame(from = NULL, to = NULL),
  wgt_klb = NULL,
  wgt_klb_L = NULL,
  wgt_klb_D = NULL
)

Arguments

rdat

BAM output rdat file object

selpar_n_yrs_wgted

Number years at end of time series over which to average sector Fs, for weighted selectivities. Almost always set to 3 in BAM. numeric vector

duplicate_sel

Specify if selectivities should be duplicated for certain fleets. Otherwise the function assumes that each fleet with F values has a selectivity defined with a fleet abbreviation matching abbreviation used in columns of rdat$parm.cons with "log_avg_F" in the name. Must be specified as a list; e.g. duplicate_sel = data.frame("from"="HB_D","to"="GR_D"), specifies that the selectivity matrix indicated by the abbreviation HB_D should be copied with a name using the abbreviation GR_D.

wgt_klb

Weight-at-age in thousand pounds for fish in the population.

wgt_klb_L

Weight-at-age in thousand pounds for fish in the landings.

wgt_klb_D

Weight-at-age in thousand pounds for fish in the discards.

Author(s)

Kyle Shertzer and Nikolai Klibansky

Examples

## Not run: 
get_weighted_current(rdat = rdat_Tilefish)
# In some cases you need to duplicate the selectivity of one fleet to fill in for another, if that was done in the assessment
get_weighted_current(rdat = rdat_VermilionSnapper,  duplicate_sel = data.frame("from"="HB_D","to"="GR_D"))

## End(Not run)

nikolaifish/bamExtras documentation built on July 21, 2023, 8:26 a.m.