calc_lw_params: Calculate length-weight relationship parameters

View source: R/utils-calc-lw-params.R

calc_lw_paramsR Documentation

Calculate length-weight relationship parameters

Description

Calculate length-weight relationship parameters for the data with both length and weight data, given one or more grouping variables.

Usage

calc_lw_params(d, grouping_cols = "year", lw_tol = 0.1, lw_maxiter = 1000)

Arguments

d

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

grouping_cols

A vector of character strings matching the names of the columns you want to group for. i.e. "year" or c("year", "month")

lw_tol

See fit_lw()

lw_maxiter

See fit_lw()

Details

If the column lw_alpha already exists in the input data frame d, the calculated parameters lw_alpha and lw_beta will be coalesced with the input ones. This means they will be combined together similar to a union or left join. The input parameter values will take precedence and the NA values found in that column will be replaced with the parameter estimates calculated here with fit_lw().

Value

The original data frame with the columns lw_alpha and lw_beta added (if necessary). If those columns exist, they will be overwritten with NAs and values calculated where data exist


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