unPackDataChecks: Perform various data quality checks on in-process data from...

unPackDataChecksR Documentation

Perform various data quality checks on in-process data from Data Packs.

Description

A series of functions to check and validate quality & integrity of data encountered in various unPack... functions across datapackr. Note that these functions do not attempt to correct issues identified, but only to identify them.

checkToolStructure checks structural integrity of sheets for submitted tool.

checkToolComments searches Data Pack for any comments that cause corruption when executing openxlsx::saveWorkbook.

checkToolConnections detects the presence of any external links in a Tool.

checkToolEmptySheets detects whether a sheet is essentially empty (no data in rows, or no data in row 14 column headers).

checkDupeRows checks for any rows with duplicates across PSNU and other key disaggregates.

checkColumnStructure checks structural integrity of columns on critical sheets for a submitted Data Pack.

checkNonNumeric alerts to non-numeric values instead of valid data.

checkMissingMetadata alerts to missing Age, Sex, or KeyPop.

checkNegativeValues alerts to negative values.

checkDecimalValues alerts to decimal values where these are unallowed.

checkInvalidOrgUnits alerts to invalid org units.

checkInvalidPrioritizations alerts to invalid Prioritizations.

checkFormulas checks formulas in a specified sheet in a submitted Data Pack to make sure they are up to date and have not been tampered with.

checkDisaggs alerts to invalid disaggs (Age, Sex, KeyPop).

Some functions (checkToolStructure, checkToolComments, & checkToolConnections) are designed to check across entire tools at once. All others are specific to single sheet.

Usage

checkToolStructure(d, quiet = TRUE)

checkToolComments(d, quiet = TRUE)

checkToolConnections(d, quiet = TRUE)

checkDupeRows(sheets, d, quiet = TRUE)

checkMissingCols(sheets, d, quiet = TRUE)

checkDupeCols(sheets, d, quiet = TRUE)

checkOutOfOrderCols(sheets, d, quiet = TRUE)

checkNonNumeric(sheets, d, quiet = TRUE)

checkNegativeValues(sheets, d, quiet = TRUE)

checkDecimalValues(sheets, d, quiet = TRUE)

checkInvalidOrgUnits(sheets, d, quiet = TRUE)

checkInvalidPrioritizations(sheets, d, quiet = TRUE)

checkFormulas(sheets, d, quiet = TRUE)

checkDisaggs(sheets, d, quiet = TRUE)

checkToolEmptySheets(d, sheets, quiet = TRUE)

checkSheetData(d, sheets = NULL, quiet = TRUE, ...)

Arguments

d

DataPack object loaded via loadDataPack.

quiet

Logical. Should warning messages be printed? Default is TRUE.

sheet

String. Name of DataPack sheet to check data from. Default is first sheet.

Value

A DataPack object, with updated tests and warnings.


pepfar-datim/datapackr documentation built on April 14, 2024, 10:35 p.m.