ReportFdaSampling: Report FDA sampling

View source: R/StoxReportFunctions.R

ReportFdaSamplingR Documentation

Report FDA sampling

Description

Report sampling of fisheries against landings in partitions of the fisheries.

Usage

ReportFdaSampling(
  StoxBioticData,
  StoxLandingData,
  GroupingVariables = character(),
  Decimals = integer(),
  Unit = RstoxData::getUnitOptions("mass", conversionRange = c(1, 1e+12)),
  SamplingVariables = character()
)

Arguments

StoxBioticData

StoxBioticData data with samples from fisheries and approriate columns added for identifying corresponding landings.

StoxLandingData

StoxLandingData data with landings from fisheries and approriate columns added for identifying corresponding samples

GroupingVariables

Columns of 'StoxBioticData' and 'StoxLandingData' that partitions the fisheries. If not provided, a single row for all landings will be produced.

Decimals

integer specifying the number of decimals to report for 'LandedRoundWeight' and 'WeightOfSampledCatches'. Defaults to 0.

Unit

unit for the weights 'LandedRoundWeight' and 'WeightOfSampledCatches'. Defaults to kg

SamplingVariables

Columns of 'StoxBioticData' identifying sampling variables to be use to partition the report. See details.

Details

Sampling is reported partitioned on the provided 'GroupingVariables', which must be present in both samples (StoxBioticData) and landings (StoxLandingData). If samples are encoded in partitions of the fisheries with no landings. 'LandedRoundWeight' will be NA. This may be due to recording errors or filtering errors, but it may also be due to comparison of similar but unequal category-definitions. For instance area are coded in landings as dominant area for a fishing trip, while at-sea sampling will record area of fishing operation, and the catch from that area by subsequently be landed with another area listed as dominant area.

Note that the columns Catches and Vessels summarize the number of unique catches and vessels in each partition / cell. So depending on which grouping variables are added, the sum of vessels does not have to correspond to the total sum of vessels in the fleet. In principle the same applies to Catches, but in practice that situation does less commonly arise.

In addition sampling may be reported partitioned on the provided 'SamplingVariables'. For instance the variable 'IndividualSex' may be provided to see how many samples are collected for each sex. NAs will be treated as a separate category. When 'SamplingVariables' are provided, each partition specified by 'GroupingVariables' will be reported several times, so that the sum of the column 'LandedRoudnWeight' will not be the total landings. 'SamplingVariables' must be columns that are only present in samples (StoxBioticData), not in landings (StoxLandingData).

Rounding of numbers according to the argument 'Decimals' is done with round, so that negative numbers specify rounding to powers of ten, and rounding of the digit 5 is towards the even digit.

The units considered valid for weights are those listed for quantity 'mass' in StoxUnits

Value

ReportFdaSamplingData

Examples

  samplingreport <- RstoxFDA::ReportFdaSampling(RstoxFDA::StoxBioticDataExample, 
      RstoxFDA::StoxLandingDataExample, GroupingVariables = c("GearGroup"), Unit = "ton")
  samplingreport$FisheriesSampling

StoXProject/RstoxFDA documentation built on Dec. 17, 2024, 10:58 a.m.