getComps: Aggregate composition data by length, age, or age-at-length...

Description Usage Arguments Details Value Author(s)

View source: R/getComps.R

Description

Workflow

getComps is run subsequently to getExpansion_2.

Usage

1
2
getComps(Pdata, strat = NULL, Comps = "AAL", defaults = c("fleet",
  "fishyr", "season"), verbose = TRUE)

Arguments

Pdata

A PacFIN data.frame

strat

A character value or vector of character values, of which are prepended to defaults. For instance if you wish to add ageing method as a stratification use strat = 'agemethod'.

Comps

The type of composition data to create. Options are length ('LEN', age ('AGE'), or conditional age-at-length ('AAL').

defaults

The default stratification columns which will typically be left at their default value of c('fleet', 'fishyr', 'season').

verbose

A logical value specifying if output should be written to the screen or not. Good for testing and exploring your data but can be turned off when output indicates errors. The default value is TRUE.

Details

The aggregation is of the Pdata$Final_Sample_Size column value, which should be set to the desired expansion:

Pdata$Final_Sample_Size = Pdata$Expansion_Factor_1

or

Pdata$Final_Sample_Size = Pdata$Expansion_Factor_1 * Pdata$Expansion_Factor_2

The default stratification is by fleet, fishyr, and season. Columns lengthcm, age or both are added depending on the Comps argument.

Value

A dataframe with composition data specific to the type specified in Comps for males, females, and unsexed records.

Author(s)

Andi Stephens, Kelli Faye Johnson


nwfsc-assess/PacFIN.Utilities documentation built on June 30, 2017, 8:49 a.m.