Calculate expanded discard composition

get_biological_data(
  biological_data,
  catch_data,
  weight_data,
  species_name,
  length_bins,
  age_bins,
  gear_groups,
  gear_names,
  fleet_colname,
  fleet_groups,
  fleet_names,
  dir = NULL,
  expand = TRUE
)

Arguments

biological_data

A data frame of WCGOP biological data that includes all species. The full biological data frame is filtered down to selected species and to include only discard data (catch_disposition == "D").

catch_data

A data frame of WCGOP catch data that includes all species. This data frame will be used to check confidentiality.

weight_data

A data frame created by [get_weights()] that will be used to weight the biological data samples.

species_name

Species name to process discard biological data for. The casing needs to match WCGOP biological species column that capitalizes the first letter of each name (e.g., Canary Rockfish, Sablefish).

length_bins

Vector of integers to bin length data by to create discard composition data. Values above or below the minimum or maximum values in the vector are grouped into the first size or plus group size, respectively. For example, creating length compositions that uses a vector bin of seq(10, 50, 2) would create 2 cm bins where fish length between [0, 11.99) would be included in the 10 cm bin, fish of length [12, 13.99) would be included in the 12 cm bin, and all fish [50- Inf) would be included in the 50 cm plus bin.

age_bins

Vector of integers to bin age data by to create discard composition data. Values above or below the minimum or maximum values in the vector are grouped into the first age or plus group age, respectively. For example, creating age compositions that uses a vector bin of seq(1, 20, 1) would create 1 year age bins where fish age between [0, 1) would be included in the 1 age bin and all fish [20- Inf) would be included in the 20 age plus bin.

gear_groups

List object of gear names to group together based on the WCGOP gear column, example: list(c("Bottom Trawl", "Midwater Trawl"), c("Hook & Line", "Pot", "Fixed Gear")).

gear_names

Vector of gear group names that needs to match the length of the gear_groups object and align in order of the assigned names. For example, if gear_groups = list(c("Bottom Trawl", "Midwater Trawl"), c("Hook & Line", "Pot", "Fixed Gear")) then gear_names = c("trawl", "fixed gear")).

fleet_colname

Column in the biological data that should be used to define the fleet areas. Commonly used columns is r_state which can allow you to group or split data by state. The area column can be used to split data north and south of 4010 N. lat.

fleet_groups

List object of how to combine the data to define fleet groups. For example, list(c("WA", "OR"), "CA") would define WA-OR and CA fleets.

fleet_names

Vector of fleet names that needs to match the length of the fleet_groups object and align in order of the assigned names. For example, the fleet_names should be c("OR-WA", "CA") to align with a fleet_groups of list(c("WA", "OR"), "CA").

dir

Directory where output will be saved. The directory where the file should be saved. If dir = NULL no output will be saved.

expand

Logical statement on whether to expand the compositions samples. Default is TRUE. If set to FALSE, then raw samples will be returned that are filtered for confidentiality.

Author

Chantel Wetzel