RoMEBS {RoMEBS}R Documentation

R code to perform multiple checks on MEDITS-like Survey data (TA, TB, TC, TE and TL files)

Description

The function calls all the functions built in the package in an ordered way to perform a complete quality check of TX data available. The check is performed simultaneously on the files that can contain also data of more than one year.

Usage

function(TA, TB, TC, TE = NA, TL = NA, wd, suffix = NA,
verbose= TRUE,
Strata = RoMEBS::Stratification,
Ref_list =RoMEBS::TM_list,
LW_table = RoMEBS::LW,
TargetSpecies = RoMEBS::DataTargetSpecies,
Maturity = RoMEBS::Maturity_parameters,
mstages =RoMEBS::mat_stages,
ass_TL = RoMEBS::assTL)

Arguments

TA

Haul data table according to MEDITS protocol (TA)

TB

Catch data table according to MEDITS protocol (TB)

TC

Biological data table according to MEDITS protocol (TC)

TE

Individual biological data table according to MEDITS protocol (TE) if available, if TE data are not available, use NA.

TL

Litter data table according to MEDITS protocol (TL) if available, if TL data are not available, use NA

wd

working directory path defined by the user

suffix

Suffix string of the Logfile, in case it suffix=NA it is automatically generated by the function using date and time of the check

verbose

...

Strata

Stratification scheme according to MEDITS protocol.

Ref_list

TM_list reference list

LW_table

Table of the Length-Weight parameters

TargetSpecies

Information related to target species.

Maturity

Information related to sex and maturity from literature or other sources.

mstages

Table of maturity stages.

ass_TL

data frame with the association between TL (litter table) categories and sub-categories

Details

RoMEBS checks can be used to integrate a list of common quality checks on survey data. This function calls all the functions built in the package in an ordered way to perform a complete quality check of TX data available. The order of the checks in RoMEBS was implemented in a defined sequence to avoid cascade errors due to the correction of a previous error. No automatic correction is implemented in RoMEBS. RoMEBS stops if an error occurs; then the user has to correct the error and run again the code to continue with the other checks. The function runs on a complete time series dataset, checking year after year, until the end of the time series. After the checks of the mandatory fields and the controlled vocabulary, that are carried out for all the TX tables, the specific checks on each kind of TX table are performed. Finally, RoMEBS provides a list of cross checks aimed to guarantee the consistency among the data tables.

Some functions included in the RoMEBS library and used by RoMEBS function need specific dictionaries or tables. It is the case of Stratification, TM_list, DataTargetSpecies, Maturity_parameters, stages and assTL tables. All of them are provided by default in this library. Anyway, the user has the possibility to provide ad hoc modified versions of these tables adapting the checks to specific needs.

Value

The function does not correct data, but it detects the errors, warning the user that there is the possibility of one or more errors, specifying the type of the error and easing the data correction. If parameter verbose=TRUE returns a series of text output in console to let the user to trace the state of the checks. All the output of the functions are stored in the user defined working directory wd and in the sub-directory there resident. In the Lofile subfolder are stored the logfiles of each run of the function.

Author(s)

I. Bitetto, W. Zupa

References

Anonymus (2017) "MEDITS-Handbook. Version n. 9. MEDITS Working Group. 106 pp." https://www.sibm.it/MEDITS 2011/docs/Medits_Handbook_2017_version_9_5-60417r.pdf

Examples

    
    library(RoMEBS)
    wd <- tempdir()
    suffix=NA
    verbose= TRUE
    DataTA = RoMEBS::TA
    DataTB = RoMEBS::TB
    DataTC = RoMEBS::TC
    DataTE = NA
    DataTL = NA

RoMEBS(DataTA, DataTB,DataTC,DataTE,DataTL, wd, suffix,verbose=TRUE,
       Strata=RoMEBS::Stratification,
       Ref_list=RoMEBS::TM_list, LW_table=RoMEBS::LW,
       TargetSpecies=RoMEBS::DataTargetSpecies,
       Maturity=RoMEBS::Maturity_parameters,
       mstages=RoMEBS::mat_stages,ass_TL=RoMEBS::assTL)
    

[Package RoMEBS version 0.2.02 Index]