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

create.fleets.arrays(stk_objs, caa_objs, caa_objs_path, price_objs,
price_objs_path, catch_obj, effort_obj, flt_obj = NULL, stk_nms = NA,
flt_nms, flt_mt_nms, flt_mt_stk_nms, ages = NULL, hist.yrs, sim.yrs,
mean.yrs, new_hist.yrs = hist.yrs, update_catch_effort = TRUE,
update_price = TRUE, update_weight = TRUE,
caa_flt_mt_correspondences = NULL, paa_flt_mt_correspondences = NULL,
caaOpt, priceOpt, excel = TRUE)

Arguments

stk_objs A character vector with the names of the files containing the stocks data. See create.biol.arrays for more detail. Supported format is only Excel (xls and xlsx), each stock can be in different format. A character vector with the names of the files containing the catch at age data (in numbers), both for landings and discards. Supported formats are Excel (xls and xlsx) and R format (RData), each file can be in different format. The number of required files depend of the value of caaOpt argument: caaOpt = 1 or 2 => one per stock and fleet. Named vector stknm_fltnm caaOpt = 3, 4 or 5=> one per stock. Named vector stknm If NULL, the function looks for "caa_stknm_flnm.xlsx" in caaOpt = 1 or 2 and "caa_stknm.xlsx" in caaOpt = 3 ,4 or 5. A character vector with the caa_objs file path. A character vector with the names of the files containing the price at age data. Supported formats are Excel (xls and xlsx) and R format (RData), each prices file can be in different format. The number of required files depend of the value of caaOpt argument: caaOpt = 1 or 2 => one per stock and fleet. Named vector stknm_fltnm. caaOpt = 3, 4 or 5=> one per stock. Named vector stknm. A character vector with the price_objs file path. A character vector with the names of the files containing the catch data in Fcube format. Supported formats are Excel (xls and xlsx) and R format (RData) and required columns are 'year', 'fleet', 'metier', 'stock', 'category' and 'catch'. A character vector with the names of the files containing the effort data in Fcube format. Supported formats are Excel (xls and xlsx) and R format (RData) and required columns are 'year', 'fleet', 'metier' and 'effort'. Both catch_obj and effort_obj must be in the same format. An FLFleets object (optional) with the structure of the fleet and which may contain historical data. If this object is provided, then the arguments stk_nms, flt_nms, flt_mt_nms and ages will not be used and excel argument must be set to FALSE. A character vector (optional) with the name of all the stocks caugth by the different fleets. A character vector with the name of the fleets. A list with one element per fleet. In turn, each element is a character vector with the names of the metiers in the corresponding fleet. A list with one element per fleet and metier. In turn, each element is a character vector with the names of the stocks in the corresponding fleet and metier. A list with one element per stock, with the age classes of the stock. A vector with the historical years. A vector with the simulation years. A vector with the years used to compute the mean to condition the parameters in the projection period. A vector with the years from input files that will be used to condition the parameters in the historic years. If a value is not provided, the it is set equal to hist.yrs. Logical. If TRUE (default), catch and effort must be provided and catch_obj, effort_obj arguments are required. Logical. If TRUE (default), prices must be provided and price_objs and price_objs_path arguments are required. Logical. If TRUE (default), weights at age for landings and discards must be provided, so wl and wd sheets are required in files listed in stk_objs argument. An Excel file name. This file must contain one sheet per stock, with the correspondences between the fleet segments used in caaa_obj data and the fleet metier segmentation used in the analysis. If the file does not exist, it is supposed that the caa data is given by fleet and metier. An Excel file name. This file must contain information on prices correspondences, with same format and requirements as caa_flt_mt_correspondences argument. A code number to determine the way in wich catch at age data are provided. The option to be used depends on the data availabiltiy, from data rich to data-poor and the following codes are available: 1If catch at age data is available at metier level for all the metiers. 2If catch at age data is only available at fleet level. 3If catch at age data is disaggregated but the segments do not correspond exactly with the metiers/fleets considered in the case study. 4If catch at age data is only available at stock level. 5If we want to use the data available previously in the FLCatch objects from flt_obj to derive catch profiles at age and then apply caaOpt==3 using only one fleet segment, fseg, which represents all the fleets and metiers. Note: This approach could lead to a different total catch at age profile derived from the fleets to those in the stocks. A code number to determine the way in wich price at age data are provided. The option to be used depends on the data availabiltiy, from data rich to data-poor and the following codes are available: 1If price data is available at metier level for all the metiers. 2If price data is only available at fleet level. 3If price data is disaggregated but the segments do not correspond exactly with the metiers/fleets considered in the case study. 4If price data is only available at stock level. Logical. If TRUE (default), the data in the Excel file is used to create the stucture of the FLFleets object; whereas if FALSE, the flt_obj object is used instead.

Value

An FLFleetsExt.

FLFleetsExt, create.biol.arrays