getLandings: Formats landings for R-ECA.

Description Usage Arguments Details Value Examples

View source: R/prepRECA.R

Description

Prepares a Landings object as required by eca.predict.

Usage

1
2
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

1
2
3
4
5
6
7
 samples <- prepRECA::NORportsampling2018$LE
 samples$Metier5 <- samples$LEmetier5
 landings <- CLCodHadNOR
 landings$LiveWeightKG <- landings$OfficialLandingsWeight
 landings$Metier5 <- landings$FishingActivityCategoryEuropeanLvl5
 covMap <- getCovariateMap("Metier5", samples, landings)
 getLandings(landings, c("Metier5"), covMap, month=landings$Month)

edvinf/prepRECA documentation built on Nov. 11, 2019, 6:30 a.m.