adfg.ExportWideZCs: Export size compositions in wide format

View source: R/adfg.ExportWideZCs.R

adfg.ExportWideZCsR Documentation

Export size compositions in wide format

Description

Function to export size compositions in wide format.

Usage

adfg.ExportWideZCs(
  dfrSSs,
  dfrZCs,
  byFacs = c("fishery", "area", "sex", "shell condition", "year"),
  sizeCol = "size",
  valCol = "abundance",
  ssCol = "ss",
  csvSSs = "dfrSSs.csv",
  csvZCs = "dfrZCs.csv",
  writeFiles = TRUE,
  verbose = FALSE
)

Arguments

dfrSSs
  • dataframe with sample size information

dfrZCs
  • size composition dataframe

byFacs
  • character vector of size composition factors to include in ouptut

sizeCol
  • name of column in dfrZCs with sizes

valCol
  • name of column in dfrZCs with abundance values

ssCol
  • name of column in dfrSSs with sample sizes

csvSSs
  • name of csv file to save sample size to

csvZCs
  • name of csv file to save size compositions to

writeFiles
  • flag (T/F) to write csv files (default=TRUE)

verbose
  • flag (T/F) to print diagnostic information

Details

Uses sqldf::sqldf, reshape2::dcast, and wtsUtilities::Sum. Input column names should given "as is" and NOT be backquoted.

Value

A list with named elements

  • tblZCs - the wide-format size compositions

  • tblSSs - a dataframe with sample sizes


wStockhausen/tcsamFisheryDataADFG documentation built on April 18, 2023, 12:56 p.m.