getLandings: Formats landings for R-ECA.

View source: R/RecaWrap.R

getLandingsR Documentation

Formats landings for R-ECA.

Description

Prepares a Landings object as required by eca.predict.

Usage

getLandings(
  landings,
  covariates,
  covariateMaps,
  date = NULL,
  month = NULL,
  quarter = NULL
)

Arguments

landings

data.table() with total landings (as in prepRECA, and rEcaDataReport), each row corresponding to one cell. Contains columns:

LiveWeightKG

numeric(). Total landings (Live/Round weight in Kg) for the cell

...

Additional columns to be used as covariates. These define each cell. Type of covariate must be sepcified in 'fixedEffects', 'randomEffects' or 'carEffect'

covariates

character() vector of covariates used in model

covariateMaps

list() mapping covariate values from integers used in RECA to values used in 'landings'. For a covarate 'cov', the integer i is used for value a, when covariateMaps[[cov]][[i]] == a

date

POSIXct() vector, matching the number of rows in 'landings', date of catch, see details.

month

integer() vector, matching the number of rows in 'landings', month of catch (1 for January, etc.), see details.

quarter

integer() vector, vector, matching the number of rows in 'landings', quarter of catch (1 for Q1, etc.), see details.

Details

The parameters 'date', 'month', and 'quarter' are used to set the temporal resolution for catch at age prediction. Provide exactly one of these, and set the other ones to NULL. Temporal resolution need not match any temporal covariate used. One can for example run with month, even if Quarter is a covariate in the model.

Value

Landings object as required by eca.predict

Examples

 data(catchsamples)
 data(landings)
 catchsamples$Metier5 <- catchsamples$LEmetier5
 landings$Metier5 <- landings$FishingActivityCategoryEuropeanLvl5
 covMap <- getCovariateMap("Metier5", catchsamples, landings)
 getLandings(landings, c("Metier5"), covMap, month=landings$Month)

StoXProject/RstoxFDA documentation built on Nov. 12, 2024, 3:42 a.m.