addcount: addcount - adds a count of years and avC to a data.frame

Description Usage Arguments Value

View source: R/cpuefuncs.r

Description

addcount - given an input data.frame containing catch_kg, Vessel, and Year as variables this function first sums the catch by vessel, by year, then counts each vessels occurrence across the years, and each vessels catch. Then stepping through each vessel it populates two new colummns named 'count' and 'avC'.

Usage

1
addcount(indat, varid = "Vessel", group = "Year", catch = "catch_kg")

Arguments

indat

- a data.frame containing at least columns named 'catch_kg', 'Vessel' (or in fact 'varid'), and 'Year'.

varid

the variable in the data.frame for which the count and avearge catch per year is to be estimated. Defaults to 'Vessel' ready for the SESSF but could be diver_id for abalone, or any other factor of interest.

group

the first grouping variable, typically Vessel in the SESSF

catch

the variable name for the catch, catch_kg in the SESSF

Value

a data.frame made of the input data.frame plus two new columns


haddonm/r4cpue documentation built on May 11, 2020, 1:31 a.m.