chuck.zeros: chuck.zeros

View source: R/chuck_zeros.R

chuck.zerosR Documentation

chuck.zeros

Description

Removes zeros before the first non-zero catch, and the same for zeros following the last non-zero catch.

Usage

chuck.zeros(b, e, beg.buff, end.buff, df)

Arguments

b

An integer representing the number of zeros and NA trapping instances to keep before the first non-zero and non-NA catch record. Always set to zero.

e

An integer representing the number of zeros and NA trapping instances to keep after the last non-zero and non-NA catch record. Always set to zero.

beg.buff

An integer. The actual number of zeros and NA trapping instances prior to the first non-zero and non-NA catch record in the original data frame df.

end.buff

An integer. The actual number of zeros and NA trapping instances after the last non-zero and non-NA catch record in the original data frame df.

df

A data frame containing catch records for one particular trap's temporal sequence.

Details

Manipulation of the b and e variables specifies the number of trapping days with preceding and antecedent zeros to retain. Thus, the number of zero catch records both before the first and after the last caught fish is independently adjustable.

Note that variable n.tot in data frame df identifies zero and NA catch records.

Value

A data frame, necessarily a subset of the data frame df provided to the function, with all zero and NA catch records removed before the first, and after the last, valid catch record.

Author(s)

WEST Inc.

See Also

max.buff.days

Examples

## Not run: 
#   ---- Remove all zero and NA records before the first non-zero and non-NA
#   ---- catch record in record 4 in data frame catch.df.  Do the same for
#   ---- the last, which is in record 12.  
df <- chuck.zeros(0,0,4,12,catch.df)

## End(Not run)

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