Process age data from the Pacific Hake U.S. at-sea fishery

process_age_sea(
  atsea.ages = get_local(file = "atsea.ages.Rdat"),
  ncatch = get_local(file = "norpac_catch.Rdat"),
  years = 2008:hakedata_year(),
  ages = 1:15,
  files = fs::path(hakedata_wd(), paste0("us-", c("cp", "ms"), "-age-proportions.csv")),
  write = TRUE
)

Arguments

atsea.ages

An R object with NORPAC ages. The default value is NULL, where the object will be read from a saved object within a directory called extractedData.

ncatch

An R object of NORPAC catches. The default value is loaded from the disk using get_local(). Otherwise, the R object is typically stored in the hakedata environment.

years

A vector of integers specifying the years of data that you wish to process. Typically all years prior to 2008 are left static despite updates to the data.

ages

A vector of ages to be included in the composition data. The default is to include ages from one to fifteen.

files

File paths to the exported csv files. Must have lower case "cp" or "ms" in the file name so the correct vessel type is chosen.

write

A logical specifying if the data should be written to the disk. The default is TRUE.

Value

A list object with summary information regrading the composition data. Multiple files are saved to the disk as well. These saved files include summary information in ...report.txt files and comps.csv files.

Author

Kelli F. Johnson