Skip to contents

Reads, cleans, and formats catch observation data to prepare it for model fitting within an `Rpath` simulation scene object.

Usage

read.fitting.catch(Rsim.scenario, catch_data)

Arguments

Rsim.scenario

An `Rsim` scenario object containing simulation parameters and setup.

catch_data

A `data.frame` containing catch observation data. Expected to contain the columns: `Group`, `Year`, `Value`, `Stdev`, and `Scale`.

Value

Modifies and returns the Rsim.scenario, attaching the formatted data frame to `Rsim.scenario$fitting$Catch` with additional calculated columns (`obs`, `sd`, `wt`).

Details

The function performs several filtering and data-cleaning steps on `cdat`: * Drops species/groups in the data that are not present in the model. * Removes rows containing `NA` in the `Value` column. * Filters out observations that fall outside the model's defined run years. * Calculates `obs` (observed catch) by multiplying `Value` by `Scale`. * Calculates `sd` (standard deviation) by multiplying `Stdev` by `Scale`.