read.fishmort: read.fishmort

View source: R/read.fishmort.R

read.fishmortR Documentation

read.fishmort

Description

Reads the fishing mortality from the fishmort file that is output by Multifan-CL. The fishing mortality in the fishmort file is by region, time period, fishing incident and age. This function returns the fishing mortality by region, year, season, fishery and age. As the fishmort file has values by fishing incident rather than fishery, the structure of realisations from the freq file are necessary as function arguments so ensure the correct fishing mortality is allocated to the correct fishery. We also need a map of fishery to region - this can be generated from an MFCLFreq object. The fishmort file provides fishing mortality on a log scale. The read.fishmort() function transforms them to 'normal' scale (or whatever it's called). Note that summing these fishing mortalities by region, time and age period yields the same values as reported in the 'fm' slot of an MFCLRep object. But summing by time and age does not yield the same values as in the 'fm_aggregated' slot which seems to be something to do with the yield analysis.

Usage

read.fishmort(
  file = "fishmort",
  realisations = NULL,
  fishery_region = NULL,
  nages = NULL
)

Arguments

file

A character string giving the name and path of the fishmort file to be read in.

realisations

A data.frame with columns of year, month and fishery where each row is a fishing incident. Probably easiest to get this by calling the realisations() function on an MFCLFrq object.

fishery_region

A data.frame with columns of fishery and region that maps fishery to region. Probably easiest to get this using the region_fish() function on an MFCLFrq object (see example below).

nages

An integer with the number of ages (expressed as time periods) in the stock, e.g. no. ages in years x no. seasons in the model.

Value

An FLQuant with fishing mortality by age, year, fishery and season.

Examples

## Not run: 
freq <- read.MFCLFrq("my_mfcl_op_path/bet.frq")
fishery_region_df <-  data.frame(fishery=1:length(c(region_fish(freq))), region= c(region_fish(freq)))
fish_mort <- read.fishmort(file = "my_mfcl_op_path/fishmort", realisations = realisations(freq), fishery_region = fishery_region_df, nages=40)

## End(Not run)


robscott3/FLR4MFCL documentation built on April 9, 2024, 3:31 p.m.