SurveyAFs.fn: Expands the ages up to the total stratum area then sums over...

View source: R/SurveyAFs.fn.R

SurveyAFs.fnR Documentation

Expands the ages up to the total stratum area then sums over strata Original Version Written by Allan Hicks 16 March 2009 Modified by Chantel Wetzel to work with the data warehouse data formatting, add additional options of when to apply the sex ratio, and correct some treatment of unsexed fish weighted by sample size and area NOTE: The age bin called F0 or M0 is retained to show proportion of ages smaller than smallest bin You will want to likely add this to your first age bin and delete this before putting in SS, or start the ageBins argument at the 2nd age bin and F0 will be all fish smaller (hence the first age bin)

Description

Expands the ages up to the total stratum area then sums over strata Original Version Written by Allan Hicks 16 March 2009 Modified by Chantel Wetzel to work with the data warehouse data formatting, add additional options of when to apply the sex ratio, and correct some treatment of unsexed fish weighted by sample size and area NOTE: The age bin called F0 or M0 is retained to show proportion of ages smaller than smallest bin You will want to likely add this to your first age bin and delete this before putting in SS, or start the ageBins argument at the 2nd age bin and F0 will be all fish smaller (hence the first age bin)

Usage

SurveyAFs.fn(
  dir = NULL,
  datA,
  datTows,
  strat.vars = c("Depth_m", "Latitude_dd"),
  strat.df = NULL,
  ageBins = 1,
  SSout = TRUE,
  meanRatioMethod = TRUE,
  sex = 3,
  NAs2zero = T,
  sexRatioUnsexed = NA,
  maxSizeUnsexed = NA,
  sexRatioStage = 1,
  partition = 0,
  fleet = "Enter Fleet",
  agelow = "Enter",
  agehigh = "Enter",
  ageErr = "Enter",
  nSamps = "Enter Samps",
  month = "Enter Month",
  printfolder = "forSS",
  remove999 = TRUE,
  outputStage1 = FALSE,
  verbose = TRUE
)

Arguments

dir

directory this is where the output files will be saved

datA

the biological data frame exctrated from the data warehouse using the PullBio.fn

datTows

the catch data frame extracted from the data warehouse using the PullCatch.fn

strat.vars

the variables used define the stratas. Defaul is bottom depth and latitudes.

strat.df

the created strata matrix with the calculated areas by the createStrataDF.fn function

ageBins

length bins

SSout

if True the output is in a format pastable into SS dat file

meanRatioMethod

TRUE/FALSE

sex

sex value for Stock Synthesis

NAs2zero

change NAs to zeros

sexRatioUnsexed

sex ratio to apply to any length bins of a certain size or smaller as defined by the maxSizeUnsexed

maxSizeUnsexed

all sizes below this threshold will assign unsexed fish by sexRatio set equal to 0.50, fish larger than this size will have unsexed fish assigned by the calculated sex ratio in the data.

sexRatioStage

1/2 apply the sex ratio based on the tows (1) or the expanded numbers (2)

partition

partition for Stock Synthesis

fleet

fleet number

agelow

value for SS -1

agehigh

value for SS -1

ageErr

age error vector to apply

nSamps

effective sample size for Stock Synthesis

month

month when the samples were collected

printfolder

folder where the length comps will be saved

remove999

the output object by the function will have the 999 column combined with the first length bin

outputStage1

return the first stage expanded data without compiling it for SS

verbose

A logical that specifies if you want to print messages and warnings to the console. The default is TRUE.

Author(s)

Allan Hicks and Chantel Wetzel

See Also

SurveyLFs.fn


nwfsc-assess/nwfscSurvey documentation built on April 25, 2024, 4:09 a.m.