MakeALKey: Make an age-length key with lengths as rows and ages as...

Description Usage Arguments Value Note Examples

View source: R/age_length.R

Description

MakeALKey creates an age-length key according to length frequency per age. Resulting frequency converted to proportion for application to entire length dataset.

Usage

1
MakeALKey(data, len, age, lenBreaks, breakLabs = NULL)

Arguments

data

A dataframe with length and age fields (columns).

len

Field name in data containing numeric lengths.

age

Field name in data containing nummeric ages.

lenBreaks

How lengths are binned. See cut for more information. (Supplied to breaks in cut.)

breakLabs

NULL (default), currently not used.

Value

Age-length key (length[rows] x age[columns]) with proportion or 0 in each cell. Return object is of class "table" with dimnames(<ALK>) providing Bin and Age list items.

Note

In the example below, some length bins contain no aged sample. One can adjust the "by" argument in seq as a possible fix. Or one needs to age fish within those length bins.

Examples

1
2
3
# check range(trammel_catch[["FL"]])
len_breaks <- seq(from = 50, to = 220, by = 5)
#MakeALKey(data = trammel_catch, len = FL, age = Age, lenBreaks = len_breaks)

jasondubois/sportfish documentation built on July 3, 2020, 1:01 p.m.