tidy_cpue_historical: Tidy historical CPUE data

View source: R/tidy-cpue-historical.R

tidy_cpue_historicalR Documentation

Tidy historical CPUE data

Description

The function can create trip level historical CPUE for index standardization or an "arithmetic" CPUE where the catch and effort are summed each year and divided.

Usage

tidy_cpue_historical(
  dat,
  species_common,
  year_range = c(1956, 1995),
  area_grep_pattern = c("3[CD]+", "5[ABCDE]+"),
  use_alt_year = FALSE,
  depth_band_width = 25,
  depth_bin_quantiles = c(0.001, 0.999),
  min_bin_prop = 0.001,
  type = c("trip-level-data", "arithmetic-cpue"),
  max_fe_hours = 5
)

Arguments

dat

Data from gfdata::get_cpue_historical().

species_common

A species common name in lowercase.

year_range

A range of years to include. Can go up to current year but note the management changes, particularly in 1996.

area_grep_pattern

A major statistical area as a regular expression.

use_alt_year

Should the alternate year (e.g. fishing year) column alt_year be used? If FALSE then the calendar year will be used. If this is set to TRUE then the year column will be replaced with the alt_year column.

depth_band_width

The depth band widths in m.

depth_bin_quantiles

Quantiles for the depth bands. If the cumulative proportion of positive fishing events within a given depth bin is less then the lower amount or greater than the upper amount then that depth bin will be dropped.

min_bin_prop

If the proportion of fishing events for any given factor level is less than this value then that factor level will be dropped.

type

Should the trip-level data be returned (for possible future index standardization) or should the arithmetic CPUE be returned (species specific catch and all effort is summed each year and then divided.)

max_fe_hours

The maximum number of allowable hours per fishing event (e.g. per trawl). Fishing events that are longer than this will be removed. This can be used to remove erroneous fishing events. Only affects data in 1991 and after when the data are recorded as fishing events.

Details

Note that fishing events prior to 1991 are 'rolled up' in the databases to locality-specific trips. This function well aggregate fishing events into trips in 1991 and after to create a consistent form of data.

Value

A (tibble) data frame.

Examples

## Not run: 
gfdata::get_cpue_historical(end_year = 2016) %>%
  tidy_cpue_historical(species_common = "pacific cod", area_grep_pattern = "5[CD]+")

## End(Not run)

seananderson/pbs-synopsis documentation built on April 4, 2024, 1:36 p.m.