Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

alk

Create An Age-Length Key


Description

Creates an age-length key in numbers or proportions-at-age per size.

Usage

alk(age=NULL,size=NULL,binsize=NULL,type=1)

Arguments

age

a vector of individual age data.

size

a vector of individual size data.

binsize

size of the length class (e.g., 5-cm, 10, cm, etc.) used to group size data. The formula used to create bins is trunc(size/binsize)*binsize+binsize/2. If use of the raw length classes is desired, then binsize=0.

type

If type=1, numbers-at-age per size are produced. This format is used in functions alkprop, alkss, and alkD. If type=2, proportions-at-age per size are produced.

Details

Create age-length keys with either numbers-at-age per size class. Records with missing size values are deleted prior to calculation. Missing ages are allowed.

Value

A table of size, total numbers at size, and numbers (or proportions)-at-age per size class.

Author(s)

Gary A. Nelson, Massachusetts Division of Marine Fisheries gary.nelson@mass.gov

References

Quinn, T. J. and R. B. Deriso. 1999. Quantitative Fish Dynamics. Oxford University Press, New York, New York. 542 pages

See Also

Examples

## Not run: 
  data(pinfish) 
  with(pinfish,alk(age=round(age,0),size=sl,binsize=10))
 
## End(Not run)

fishmethods

Fishery Science Methods and Models

v1.11-1
GPL (>= 2)
Authors
Gary A. Nelson <gary.nelson@mass.gov>
Initial release
2019-12-13

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.