getCovariateMap: Make Covariate Map

View source: R/RecaWrap.R

getCovariateMapR Documentation

Make Covariate Map

Description

Constructs a covariate map for R-ECA

Usage

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

 data(catchsamples)
 data(landings)
 catchsamples$Metier5 <- catchsamples$LEmetier5
 landings$Metier5 <- landings$FishingActivityCategoryEuropeanLvl5
 getCovariateMap("Metier5", catchsamples, landings)

StoXProject/RstoxFDA documentation built on Jan. 13, 2024, 12:32 a.m.