Assign sex to unsexed fish based on a pre-determined sex ratio in age- or length-composition data.

doSexRatio(CompData, ratioU, maxsizeU, GTsizeU, savedir)

Arguments

CompData

A data frame of composition data returned by getComps.

ratioU

A numerical value providing the sex ratio to apply to fish less than maxsizeU. A value of 0.5 assumes an equal ratio of males to females. Values larger than 0.5 assume there are more females compared to males.

maxsizeU

A numerical value specifying the length of fish below which the sex ratio is assumed to be equal to ratioU for unsexed fish.

GTsizeU

A numerical value specifying the size of fish above which the sex ratio is assumed to be 1.0 and all fish are assumed to be female, i.e., big mamas.

savedir

A file path to the directory where the results will be saved. The default is the current working directory. The path can be relative or absolute.

Value

Returns CompData with unsexed fish now assigned to a sex, where the values for males and females in the comps have increased). The original columns for unsexed fish remain unchanged. writeComps will set the observations of unsexed fish to zero.

Details

Workflow: Sex ratios are assigned after the data is stratified by getComps and before running writeComps.

Note: If writeComps is run without performing doSexRatio, then all unsexed fish will be discarded from the composition information.

Applied sex ratios: Sex ratios may be assigned in one of four different ways:

  1. fish below maxsizeU will have the ratioU applied

  2. fish above GTsizeU are assumed to be female

  3. fish between maxsizeU and GTsizeU will have the observed sex ratio of the known-sex fish applied

  4. when there are fewer than three known-sex fish in the length bin observations from adjacent bins will be used

See also

Author

Andi Stephens, Kelli F. Johnson, and Chantel R. Wetzel