doSexRatio.Rd
Assign sex to unsexed fish based on a pre-determined sex ratio in age- or length-composition data.
doSexRatio(CompData, ratioU, maxsizeU, GTsizeU, savedir)
A data frame of composition data returned by getComps.
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.
A numerical value specifying the length of fish below which
the sex ratio is assumed to be equal to ratioU
for unsexed fish.
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.
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.
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.
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:
fish below maxsizeU
will have the ratioU
applied
fish above GTsizeU
are assumed to be female
fish between maxsizeU
and GTsizeU
will have the observed
sex ratio of the known-sex fish applied
when there are fewer than three known-sex fish in the length bin observations from adjacent bins will be used