create.biol.arrays: Function to generate an FLBiol object given inputs as arrays

View source: R/Conditioning_create.biol.arrays.R

create.biol.arraysR Documentation

Function to generate an FLBiol object given inputs as arrays

Description

This function generates an FLBiol object, given the data inputs as arrays. Supported formats are Excel (xls and xlsx) and R format (RData).

Usage

create.biol.arrays(
  filename = NULL,
  data = NULL,
  name = NA,
  ages,
  hist.yrs,
  sim.yrs,
  fbar = NULL,
  mean.yrs,
  source = "rdata",
  unit = list()
)

Arguments

filename

A character vector with the name of the files containing the stock data. Supported formats are Excel (xls and xlsx) and R format (RData). In case of using R format, the information must be stored in data object (consisting in a list with the different elements). The following information is compulsory: abundances in numbers at age (n), mean weight at age (wt), maturity (mat), natural mortality (m), moment of the year when spawning occurs in percentage (spwn), fishing mortality at age (f) and catch in numbers at age (caa). For the rest of information, if not provided, default values are set. For example, fecundity (fec) is set to 1, landings and discard in numbers at age (laa and daa) are set to cca and 0, respectively. Finally for weights, if missing, weights at age for landings (wl) and discards (wd) are set to the weights in the population and weights at age for catch (wc) are set to the weighted mean of the weights of landings and discards.

data

An R object with the stock data.

name

A character (optional) with the name of the stock.

ages

A numeric vector with the age classes of stock.

hist.yrs

A vector with the historical years.

sim.yrs

A vector with the simulation years.

fbar

A numeric vector with the age range (min,max) to be used for estimating average fishing mortality.

mean.yrs

A vector with the years used to compute the mean to condition the parameters in the projection period.

source

Character, 'excel', 'rdata', 'FLStock' or 'object'. 'rdata' (default) if an RData object is used, 'excel' if the data is provided in an Excel file, 'FLStock' if the data is provided in and FLSTock object and 'object' if the data is an object of the working environment.

unit

A list with the units of the different elements included in filename. Unitless objects must be set to ” or character(1). This parameter is only required if excel==FALSE. When using Excell files the units are taken from the first row and column (cell A1) of each sheet. If the cell is empty then units are set to NA, in case of an unitless object then 1 must be inputed into cell A1.

Value

An FLBiol.

Author(s)

Dorleta Garcia & Sonia Sanchez.

See Also

FLBiol, create.fleets.arrays


flr/FLBEIA documentation built on Feb. 22, 2024, 1:36 a.m.