F.assign.2dim | R Documentation |
Assign the missing counts of both FinalRun
and
lifeStage
when the number of fish recorded in variable
Unmarked
is greater than zero.
F.assign.2dim(catch, var1, var2)
catch |
A data frame containing records of fish itemized by combinations
of variables |
var1 |
The variable in data frame |
var2 |
A second variable in the data frame |
Function F.assign.2dim
makes a new variable with joint
levels, based on the concatenation of values in FinalRun
and
lifeStage
. It then utilizes function F.assign.1dim
on the
new joint variable, via its present.var
argument. Levels fed to
present.var
take the form FinalRun.lifeStage
, e.g.,
"Fall.Smolt"
for observed records and "Unassigned"
for
unobserved. Levels fed to absent.var
of F.assign.1dim
are
either "Yes"
for observed records, or NA
for those for which
plus-counting is necessary, i.e., where present.var="Unassigned"
.
Function F.assign.1dim
then allocates plus-counts based on the
distribution of observed joint frequencies in variable present.var
.
Following allocation to the joint values, function F.assign.2dim
then "cleans up" by breaking out the joint distribution into its
constituent parts.
Thus, for example, on completion of F.assign.2dim
, the joint
variable value of "Fall.Smolt"
becomes "Fall"
and
"Smolt"
within variables FinalRun
and lifeStage
,
respectively, with the appropriate count of plus-count fish recorded in
variable Unmarked
.
A data frame catch
containing estimates of the number of fish
with respect to both variables var1
and var2
, based on their
joint distribution.
WEST Inc.
F.expand.plus.counts
, F.assign1.dim
## Not run: # ---- Per trapping instance, where both FinalRun and lifeStage are # ---- recorded as "Unassigned", and the number of observed fish in # ---- Unmarked > 0, assign plus counts. catch2 <- F.assign.2dim(catch, FinalRun, lifeStage) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.