doSexRatio | R Documentation |
Assign sex to unsexed fish based on a pre-determined sex ratio in age- or length-composition data.
doSexRatio(CompData, ratioU, maxsizeU, GTsizeU, savedir)
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 numerical value specifying the length of fish below which
the sex ratio is assumed to be equal to |
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. |
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
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.
Andi Stephens, Kelli F. Johnson, and Chantel R. Wetzel
getComps, writeComps
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.