F.assign.2dim: F.assign.2dim

F.assign.2dimR Documentation

F.assign.2dim

Description

Assign the missing counts of both FinalRun and lifeStage when the number of fish recorded in variable Unmarked is greater than zero.

Usage

F.assign.2dim(catch, var1, var2)

Arguments

catch

A data frame containing records of fish itemized by combinations of variables trapVisitID, FinalRun, lifeStage, and forkLength. Variable Unmarked contains the number of fish represented in each record. Use of this function assumes that at least one record in variables FinalRun and lifeStage in catch both equals "Unassigned".

var1

The variable in data frame catch for which data are recorded. Function F.assign.2dim, as utilized in the estimation of passage, assumes var1="FinalRun".

var2

A second variable in the data frame catch for which data are recorded. Function F.assign.2dim, as utilized in the estimation of passage, assumes var2="lifeStage".

Details

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.

Value

A data frame catch containing estimates of the number of fish with respect to both variables var1 and var2, based on their joint distribution.

Author(s)

WEST Inc.

See Also

F.expand.plus.counts, F.assign1.dim

Examples

## 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)

tmcd82070/CAMP_RST documentation built on April 6, 2022, 12:07 a.m.