getCovariateMap: Make Covariate Map

Description Usage Arguments Details Value Examples

View source: R/prepRECA.R

Description

Constructs a covariate map for R-ECA

Usage

1
getCovariateMap(covariate, samples, landings)

Arguments

covariate

character() name of covariate to make map for

samples

data.table() the samples the covariate mapping should be defined for (must contain column specified by 'covariate')

landings

data.table() the landings the covariate mapping should be defined for (may contain column specified by 'covariate')

Details

RECA require all covariate to be formatted as integers. In order to maintain connection to other formats for the covariates, they should be converted back and forth with a pre-defined covariate map

Value

list() where the nth member represents the RECA covariate value 'n', so that for a covarate 'cov', the integer i is used for value a, when covariateMaps[[cov]][[i]] == a

Examples

1
2
3
4
5
 samples <- prepRECA::NORportsampling2018$LE
 samples$Metier5 <- samples$LEmetier5
 landings <- CLCodHadNOR
 landings$Metier5 <- landings$FishingActivityCategoryEuropeanLvl5
 getCovariateMap("Metier5", samples, landings)

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