Package: RDBEScore 0.3.0

Colin Millar

RDBEScore: Functions for the ICES Regional Database and Estimation System (RDBES)

The RDBEScore package provides functions to import and work with fisheries data downloaded from the ICES RDBES database. It also contains functions to perform estimation analysis using the resulting objects.

Authors:c, person, person, person, person, person, person, person, person, person, person, person, person, person, person, person, person, person, person, person, person, person, person, person )

RDBEScore_0.3.0.tar.gz
RDBEScore_0.3.0.zip(r-4.5)RDBEScore_0.3.0.zip(r-4.4)RDBEScore_0.3.0.zip(r-4.3)
RDBEScore_0.3.0.tgz(r-4.4-any)RDBEScore_0.3.0.tgz(r-4.3-any)
RDBEScore_0.3.0.tar.gz(r-4.5-noble)RDBEScore_0.3.0.tar.gz(r-4.4-noble)
RDBEScore_0.3.0.tgz(r-4.4-emscripten)RDBEScore_0.3.0.tgz(r-4.3-emscripten)
RDBEScore.pdf |RDBEScore.html
RDBEScore/json (API)
NEWS

# Install 'RDBEScore' in R:
install.packages('RDBEScore', repos = c('https://ices-tools-prod.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/ices-tools-dev/rdbescore/issues

Datasets:

On CRAN:

25 exports 1.38 score 17 dependencies 32 scripts

Last updated 10 months agofrom:fc7683c974. Checks:OK: 1 NOTE: 6. Indexed: no.

TargetResultDate
Doc / VignettesOKAug 17 2024
R-4.5-winNOTEAug 17 2024
R-4.5-linuxNOTEAug 17 2024
R-4.4-winNOTEAug 17 2024
R-4.4-macNOTEAug 17 2024
R-4.3-winNOTEAug 17 2024
R-4.3-macNOTEAug 17 2024

Exports:applyGenerateProbscheckRDBESDataObjectcombineRDBESDataObjectscreateRDBESDataObjectcreateRDBESEstObjectcreateTableOfRDBESIdsdoEstimationForAllStrataestimestimMCfilterAndTidyRDBESDataObjectfilterRDBESDataObjectfindAndKillOrphansfixSLidsgenerateMissingSSRowsgenerateNAsUsingSLgenerateProbsgenerateZerosUsingSLgetTablesInRDBESHierarchynewRDBESDataObjectremoveBrokenSpeciesListLinksremoveBrokenVesselLinksremovePrefixFromVarNamesrunChecksOnSelectionAndProbsvalidateRDBESDataObjectvalidateRDBESEstObject

Dependencies:clidata.tabledplyrfansigenericsgluelifecyclemagrittrpillarpkgconfigR6rlangtibbletidyselectutf8vctrswithr

Estimating Population parameters from RDBESDataObjects

Rendered fromestimating-rdbesdataobjects.Rmdusingknitr::rmarkdownon Aug 17 2024.

Last update: 2023-11-21
Started: 2022-10-13

Generating NAs using the Species List

Rendered fromgenerating-NAs-using-the-species-list.Rmdusingknitr::rmarkdownon Aug 17 2024.

Last update: 2023-11-21
Started: 2023-11-21

Generating probabilities

Rendered fromgenerating-probabilities.Rmdusingknitr::rmarkdownon Aug 17 2024.

Last update: 2023-11-21
Started: 2023-11-21

Generating Zeros using the Species List

Rendered fromgenerating-zeros-using-the-species-list.Rmdusingknitr::rmarkdownon Aug 17 2024.

Last update: 2023-11-21
Started: 2023-11-21

Manipulating RDBESDataObjects

Rendered frommanipulating-rdbesdataobjects.Rmdusingknitr::rmarkdownon Aug 17 2024.

Last update: 2023-11-21
Started: 2022-10-13

Raw Data Import

Rendered fromraw-data-import.Rmdusingknitr::rmarkdownon Aug 17 2024.

Last update: 2023-11-21
Started: 2021-11-05

Readme and manuals

Help Manual

Help pageTopics
Generate probabilities missing from RDBES DataapplyGenerateProbs
Check if a column exists in a data table and has unique valuescheck_key_column
Combine Two RDBES Raw Objects combines 2 RDBESDataObjects into a single RDBESDataObject by merging individual tables one by onecombineRDBESDataObjects
Load raw object and create prepared object Function relies on the data being correctly named following established hierarchycreateDBEPrepObj
Create an RDBES Data ObjectcreateRDBESDataObject
Creates an rdbesEStObject from prepared RDBES datacreateRDBESEstObject
Create a table of RDBES IdscreateTableOfRDBESIds
A dataset containing the RDBES "design variable" namesdesignVariables
Generates the DBE estimation object for the upper hierarchy tablesdoDBEestimantionObjUpp
Create design-based point and variance estimates from RDBES estimation object (rdbesEstimObj)doDBestimation
Estimate totals and means, and try to generate samples variances for all strata in an RDBESEstObjectdoEstimationForAllStrata
Generic function for estimation of population total and varianceestim
Multiple Count Estimator for Population Total and VarianceestimMC
Filter and remove orphan records in an RDBESDataObjectfilterAndTidyRDBESDataObject
Filter an RDBESDataObjectfilterRDBESDataObject
This function finds and removed any orphan records in an RDBESDataObject. Normally data that has been downloaded from the RDBES will not contain orphan records - however if the data is subsequently filtered it is possible to introduce orphan records.findAndKillOrphans
Internal function to identify orphan records in a given RDBESDataObject tablefindOrphansByTable
Fixes SLid in SL table (facilitating SS-SL joins).fixSLids
Generate any missing SS rows. When FOcatchReg=="All" it is expected that SScatchFraction is either "Catch" OR "Lan"+"Dis". In the latter case, if one is missing the other is to be assumed 0. This function generates SS rows for any missing catch fractions.generateMissingSSRows
Generate NAs in samples using Species List informationgenerateNAsUsingSL
Generate vector of selection or inclusion probabilitiesgenerateProbs
Private function to generate SS rowsgenerateSSRows
Generate a List of Related Data TablesgenerateTestTbls
Generate zeros in samples using Species List informationgenerateZerosUsingSL
Private function used by doEstimationForAllStrata to get the estimatesgetEstimForStratum
Private function to find which FO rows are not matching SSgetMissingSSCatchFraction
Private function to get sub-sample level and top-level SAid for SA datagetSubSampleLevel
Returns the tables for a given hierarchygetTablesInRDBESHierarchy
A dataset containing test RDBES data for H1 in the RDBESDataObject structureH1Example
A dataset containing test RDBES data for H5 in the RDBESDataObject structureH5Example
A dataset containing test RDBES data for H8 in the RDBESDataObject structureH8ExampleEE1
A dataset containing a copy of the icesSpecWoRMS code list. The latest code list data can be downloaded from https://vocab.ices.dk/icesSpecWoRMS
Internal function to remove orphan records from an RDBESDataObjectkillOrphans
A made-up dataset for testing manipulations of SA based on SLMadeUpData_for_SL_SA_tests_v1
Generate a Data TablemakeTbl
A dataset containing the mapping from database column names to R field namesmapColNamesFieldR
Constructor for RDBESDataObject classnewRDBESDataObject
A RDBESDataObject converted from package SDAResources dataset agsrsPckg_SDAResources_agsrs_H1
A RDBESDataObject converted from package SDAResources dataset agstratPckg_SDAResources_agstrat_H1
A RDBESDataObject converted from package SDAResources dataset algebraPckg_SDAResources_algebra_H1
A RDBESDataObject converted from package SDAResources dataset cootsPckg_SDAResources_coots_H1
A Multi-stage RDBESDataObject from package SDAResources dataset cootsPckg_SDAResources_coots_multistage_H1
A RDBESDataObject converted from package SDAResources dataset gpaPckg_SDAResources_gpa_H1
A RDBESDataObject converted from package SDAResources dataset schoolsPckg_SDAResources_schools_H1
A RDBESDataObject converted from package survey dataset apiclus1Pckg_survey_apiclus1_v2_H1
A Multi-Stage RDBESDataObject converted from package survey dataset apiclus2Pckg_survey_apiclus2_H1
A Clustered RDBESDataObject converted from package survey dataset apiclus2Pckg_survey_apiclus2_v2_H1
A RDBESDataObject converted from package survey dataset apistratPckg_survey_apistrat_H1
Print method for RDBESDataObjectprint.RDBESDataObject sort.RDBESDataObject summary.RDBESDataObject
Private function to process the lower hierarchies when creating the RDBESEstObjectprocRDBESEstObjLowHier
Private function to process the upper hierarchies when creating the RDBESEstObjectprocRDBESEstObjUppHier
Remove rows which are not pointing to a valid SpecliestListDetails (SL) records i.e.those rows which have a value of SpeciesListName that does not exist in the SL table.removeBrokenSpeciesListLinks
Remove rows which are not pointing to a valid VesselDetails (VD) records i.e. those rows which have a value of VDid that does not exist in the VD table.removeBrokenVesselLinks
Remove table prefix from variable namesremovePrefixFromVarNames
Run basic checks on selection methods and probabilitiesrunChecksOnSelectionAndProbs
For a given RDBESDataObject convert the required columns to the correct data types. (This function can cause an error if we have data in the columns that can't be cast to the desired data type.)setRDBESDataObjectDataTypes
One quarter of sample data from swedish shrimp landings of the SWE_OTB_CRU_32-69_0_0 fisheryshrimps
One quarter of sample data from swedish shrimp catches of the SWE_OTB_CRU_32-69_0_0 fisheryshrimpsStrat
The tables required for each RDBES hierarchy.tablesInRDBESHierarchies
Check Whether an 'RDBESDataObject' is in a Valid FormatcheckRDBESDataObject validateRDBESDataObject
Checks the data types of the columns in an RDBESDataObject against an expected list of data types. Any differences are returnedvalidateRDBESDataObjectDataTypes
check RDBES Raw Object Content Private function to do some basic checks on the content of the RDBESDataObject (e.g. all required field names are present). Function is only used by checkRDBESDataObject and should only be passed a list of non-null objectsvalidateRDBESDataObjectDuplicates
check RDBES Data Object field names Private function to do some checks on the columns of an RDBESDataObject - 1. are all required fields present? 2) are there any extra fields present? It is used by validateRDBESDataObject() and should only be passed a list of non-null objectsvalidateRDBESDataObjectFieldNames
Check whether an object is a valid RDBESEstObjectvalidateRDBESEstObject
A dataset containing aphia records for species found in icesSpecWoRMSwormsAphiaRecord