max_buff_days: max_buff_days

View source: R/max_buff_days.r

max_buff_daysR Documentation

max_buff_days

Description

Identify the number of preceding and antecdedent zeros in the catch record for an individual trap catch sequence.

Usage

max_buff_days(df, trap)

Arguments

df

A data frame containing catch records for one trapPositionID, with catch counts contained in n.tot.

trap

A vector of length one containing the trapPositionID for which buffering is necessary.

Details

Function max_buff_days is a helper function utilized in the estimation of catch, and assists to identify preceding and antecedent zeros. It works in conjunction with function F.chuck.zeros.

Value

A vector containing three values. The first contains the row index of the first non-zero / non-NA in the catch record provided via data frame df. The second contains the row index of the last non-zero / non-NA in the catch record provided via data frame df. The third contains the length of the vector containing trapVisitID-specific fish counts (vector n.tot).

Author(s)

WEST Inc.

See Also

F.chuck.zeros

Examples

## Not run: 
#   ---- Find the first and last non-zero and non-NA catch record
#   ---- for trap "12345".
vec <- max.buff.days(df,"12345")

## End(Not run)

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