make_length_classess: Put size classes on predator from observed length.

View source: R/make_length_classess.R

make_length_classessR Documentation

Put size classes on predator from observed length.

Description

Define length classes for predator and preys.

Usage

make_length_classess(
  inp_dir = ".",
  inp_file = "length_classes_config.csv",
  max_l = 9999,
  write_output = TRUE,
  out_file = "length_classes.csv",
  minus_one = -1,
  same_no_all_data = FALSE
)

Arguments

inp_dir

Input directory for inn_file.

inp_file

File name with the configuration of length classes with the format as outlined above. The file must be a CSV file

max_l

Upper length in the last "largest" length class.

write_output

Flag for saving the length classes defined on out_file

out_file

Output file with defined length classes.

minus_one

Value to define upper length in length class, e.g. minus_one= -1 will provide length classes "050-059" and "060-69" for l 50, 60 and 70.

same_no_all_data

Logical, should all size classes have the same numbering irrespective of year and quarter?

Details

This function makes length classes defined from a lower and an upper value of length (or any other size measurement) The definition of length classes is given in an input file inp_file,

see this table

l Species y1 y2 q1 q2
50 ALL 1991 2013 1 4
60 ALL 1991 2013 1 4
70 ALL 1991 2013 1 4
80 ALL 1991 2013 1 4

where l is the length used to define length classes, e.g. the first two lines will produce the sizes "050-059" and "060-69". Species is the species name for the length classes. If Species=ALL, all the species will get the same lenngth classes y1 and y2 are the year range for which the length classes will be used. q1 and q2 are the year range for which the length classes will be used.

The defined length classes are made for all combinations of Species, y1 to y1, q1 to q2.

Value

defined length classes.

Examples

## Not run: ll<-make_length_classess(inp_dir=system.file('extdata', package = 'FishStomachs'),inp_file='length_classes_config.csv')

MortenVinther/FishStomachs documentation built on Feb. 14, 2025, 7:33 a.m.