getExpansion_1.Rd
First-stage expansions account for unsampled fish in the smallest measured unit. Where, in PacFIN data, the smallest unit is that which is available to the port or dockside sampler, so more than likely a trip rather than a tow as would be with survey data.
getExpansion_1(
Pdata,
maxExp = 0.95,
Exp_WA = TRUE,
fa = NA,
fb = NA,
ma = NA,
mb = NA,
ua = NA,
ub = NA,
verbose = TRUE,
plot = FALSE
)
A data frame of biological samples
originating from the
Pacific Fishieries Information Network (PacFIN) data warehouse,
which originated in 2014. Data are pulled using sql calls, see
PullBDS.PacFIN()
.
The maximum expansion factor
(either a number or a quantile) for building expansions.
Typically, the default is 0.95.
Set maxExp = Inf
to see largest values.
Default FALSE. If TRUE, expand the WA samples.
Female specific weight length coefficient.
Female specific weight length exponent.
Male specific weight length coefficient.
Male specific weight length exponent.
Unsexed weight length coefficient.
Unsexed weight length exponent.
A logical 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 information that you already know. The printing
of output to the screen does not affect any of the returned objects. The
default is to always print to the screen, i.e., verbose = TRUE
.
Argument takes either a logical or character value specifying the file
name if you want to write the plots to a disk rather than printing them
to the console. If plot = FALSE
no plots will be generated.
If printing to the disk the character value should end in .png
as png()
is used to save the plotting device.
A data.frame
where all of the original columns in
Pdata
remain unaltered but additional columns are added.
In particular columns starting with
Expansion_Factor_1 are available for setting the Final_Expansion_Factor.
The workflow is to run getExpansion_1
after cleanPacFIN
,
which assures that all of the necessary columns are available and that the
data are in the correct units.
getExpansion_1
calls
EF1_Numerator
and EF1_Denominator
(i.e., the weight of sampled fish and
the weight of all fish of the respective species in the tow)
and returns their ratio.
Age data are expanded separately from lengths.
WA fish are generally only expanded using Expansion_Factor_2.
Other expansions are the product of Expansion_Factor_1 * Expansion_Factor_2
For age-at-length comps, set Final_Expansion_Factor to 1 because each fish represents only itself.
Called within this function are
EF1_Numerator
EF1_Denominator
.
Called after this function should be getExpansion_2
.