add.zerocatch {FSA}R Documentation

Adds zero catch values for sampling events and species that were not captured.

Description

Adds zero catch values for species that were not captured in a sampling event but were captured in at least one other sampling event (i.e., adds zeroes to the data frame for capture events where a species was not observed).

Usage

add.zerocatch(df,eventvar,specvar,idvar=NULL,zerovar=NULL)

Arguments

df A data frame containing the capture summary data.
eventvar A string indicating the variable that identifies unique capture events.
specvar A string indicating the variable that identifies the species captured.
idvar A string or vector of strings indicating the variable(s) that that are common to a unique capture events and should be repeated for each zero row added to the data frame (e.g., dates, gear type, etc.). See details
zerovar A string or vector of strings indicating the variable(s) that should be set equal to zero. See details.

Details

The data frame in df must contain a column that identifies a unique capture event (given to eventvar), a column with the name of the species capture (given to specvar), and a column containing the number of that species captured (potentially given to zerovar). This function finds all event and species combinations where catch information does not exist and creates a new data frame that contains a zero for the catch. This new data frame is then appended to the original data frame to construct a data set that has complete catch observation data in it – i.e., including zeroes for species that were not captured in some events.

The original data frame (df) may also contain columns of data not discussed above. For example, it may include columns of data that is specific to the capture event and may include such information as date, gear type, habitat, etc. The variable names for this information should be given to idvar so that it can be repeated with each zero added to the data frame. In addition, the data frame may contain other information related to the catch such as number of recaptured fish, number of fish released, etc. The variable names for this information should be given to zerovar so that zeroes can be added to these variables also (e.g., if the catch of the species is zero the number of recaptures must also be zero). Only one of idvar or zerovar needs to be given as the function will assume that the rest of variable names in the data frame (not including those given in eventvar and specvar) will be of the other type.

Value

Returns a data frame of the same type as df but with rows of zero observation data appended and the columns slightly reorganized.

Author(s)

Derek H. Ogle, dogle@northland.edu

Examples

## nothing yet

[Package FSA version 0.0-13 Index]