segmentation_datapreparation: Function to automatically separate a fleet data frame by gear...

View source: R/FleetSegmentation.R

segmentation_datapreparationR Documentation

Function to automatically separate a fleet data frame by gear class and assign ICES and ICCAT stocks.

Description

This function separates given fleet data by gear class and creates separate, conveniently named and ready-to-use data frames. It also assigns ICES stocks to catch data based on the caught species and the FAO fishing area where it was caught. Due to limits in available data, especially on a fine spatial resolution, not all ICES-stocks can be taken into account. Therefore, stocks of Nephrops norvegicus and Ammodytes spp. are based on EU definitions, not on ICES definitions. Additionally, the function automatically creates stocks based on species name and FAO area for species which are caught in larger quantities (> 100 kg) but are not part of defined ICES-stock. This feature can be shut off if the user decides not to apply the procedure and use only defined ICES-stocks. Attention! The function will drop all gear NAs!

Usage

segmentation_datapreparation(
  fleetdata,
  vessel_ID,
  shiplength,
  gear,
  species,
  area,
  catch,
  reduce = T,
  auto.generate = T,
  threshold.auto.generate = 100,
  min.share = 0
)

Arguments

fleetdata

The underlying fleet data frame. With the following arguments, the columns are specified

vessel_ID

The unquoted name of the column containing the vessel identifier

shiplength

The unquoted name of the column containing the length of the vessel in m

gear

The unquoted name of the column containing the code for the gear class

species

The unquoted name of the column containing the three-digit code for the species caught

area

The unquoted name of the column containing the code for the area in ICES/FAO coding (e.g., 27.4.a or GSA 16)

catch

The unquoted name of the column containing the catch in kg

reduce

Indicates, whether or not the resulting data frame is reduced to Ship ID, ICES stock and catch weight. Defaults to TRUE. Turned to FALSE, the resulting data frame will resemble the original data with the ICES-Stock column added. This format is used for control and correction purposes, but not for further calculations.

auto.generate

Indicates whether or stocks should be automatically generated for a) species, which are not assessed in ICES-Stocks or b) assessed by ICES, but caught out of stock-managed areas. The automatically generated stocks comprise the species name and the FAO area. The relevant quantity is defined by the argument threshold.auto.generate

threshold.auto.generate

Threshold of automatic generation of ICES stocks. Only relevant if auto.generate = T. Defaults to 100.

min.share

The minimal share a stock has to have on at least one vessels catch to be included in the stock dataframe. Defaults to 0, i.e. every stock is retained by default.

Examples

segmentation_datapreparation(fleetdata = example_fleetdata,
                              vessel_ID = ship_ID,
                              shiplength = shiplength,
                              gear = gear,
                              species = species,
                              area = fao_area,
                              catch = landings)

ESulanke/FleetSegmentation documentation built on March 27, 2023, 10:13 p.m.