pull_survey_age_proportions: Calculate age proportions for the acoustic age-2+ survey

View source: R/utils-pull-survey-.R

pull_survey_age_proportionsR Documentation

Calculate age proportions for the acoustic age-2+ survey

Description

Calculate age proportions for the acoustic age-2+ survey based on the estimated abundance at age extrapolated to the KS stratifications. This information is produced by the acoustic team and stored on the network in the kriged_len_age_abundance_table file. The original code to generate these proportions was provided by Allan Hicks and can be found on GitHub https://github.com/iantaylor-NOAA/hake-data/blob/master/Rcode/AcousticData2.R. Particularly lines 170-174 that explains the file location. The actual code to compute the compositions is pretty trivial, the difficulty is knowing what file to use. As mentioned above, abundance is key here rather than biomass.

Usage

pull_survey_age_proportions(
  year = hake::get_data_yr(),
  round = options()$digits,
  dir =
    "//nwcfile/fram/Survey.Acoustics/Survey Time Series Analysis/Historical Summary (for Kriging)/Outputs/Historical Outputs (KS Stratification with aged data)/with extrapolation/"
)

Arguments

year

An integer specifying the year of interest. The default uses get_data_yr() to get the current year for the data.

round

An integer specifying how many digits should be printed. The default is to print the options for digits stored in your R session.

dir

The directory that stores the age-composition data that have been extrapolated.

Examples

proportions <- pull_survey_age_proportions(
  year = 2021, round = 2
)
# Values to paste into .dat file
glue::glue_collapse(proportions, sep = " ")

pacific-hake/hake-assessment documentation built on Jan. 14, 2025, 9:12 p.m.