canada_create_age_proportions_csv: Create an age proportion CSV data from the sample data

View source: R/utils-canada-create-age-proportions-csv.R

canada_create_age_proportions_csvR Documentation

Create an age proportion CSV data from the sample data

Description

Create an age proportion CSV data from the sample data

Usage

canada_create_age_proportions_csv(
  d,
  type = c("ft", "ss", "jv"),
  min_date = as.Date("1972-01-01"),
  raw_counts = FALSE,
  plus_grp = 15,
  lw_tol = 0.1,
  lw_maxiter = 1000,
  weight_scale = 1000,
  by_month = FALSE,
  digits = 5
)

Arguments

d

A data frame as returned by gfdata::get_commercial_samples()

type

The fleet type to create the file for. This is needed so the function knows what the filename should be for each fleet

min_date

Earliest date to include

raw_counts

Logical. If TRUE, return raw, unweighted age proportions. If FALSE, return the age proportions weighted by sample and catch weights

plus_grp

Age plus group for maximum grouping

lw_tol

See fit_lw()

lw_maxiter

See fit_lw()

weight_scale

A value to divide the weights by

by_month

Logical. If TRUE, return a data frame with a month column in addition to a year column

digits

The number of decimal places to round the values to

Details

A CSV file will be written, and the data frame will also be returned invisibly. The data frame will contain the year, number of fish by year in the data, and the number of samples (hauls/trips) in the data. Shoreside uses trips as a sampling unit and the other two use hauls.

Value

The age proportion data frame, invisibly


pacific-hake/hake-assessment documentation built on July 21, 2024, 8:19 a.m.