cleaning_log_helper: Cleaning Log Helper

View source: R/cleaning_log_helper.R

cleaning_log_helperR Documentation

Cleaning Log Helper

Description

Function to facilitate creation of cleaning log segments for single types of flags.

Usage

cleaning_log_helper(df, uuid, flag, cols, description = NULL)

Arguments

df

Inputs a dataframe with flags, and selection of columns with values to clean if record is flagged

uuid

Inputs a character value of the uuid column name.

flag

Inputs a character value of the column specifying flagged records for a single type of issue. Flag columns must be coded as a 1 for flagged, or 0 if no flag or issue.

cols

Inputs a character vector of column names that should be included in the exported cleaning log.

description

Inputs a character, or brief custom description of the type of flag. To be included in the cleaning log.

Value

Returns a REACH style cleaning log listing all flags of the specified type, and variables/values to be checked or cleaned because of that flag for all flagged records.

Examples

## Not run: cl <- cleaning_log_helper(df = df, uuid = "uuid_col", flag = "flag_wgss_age",
cols = c("age_years", wgss_vars), description = "Washington Group Short Set values
are present for a person under-5 years of age. This indicator set is not applicable for
this age group.")
## End(Not run)

SaeedR1987/healthyr documentation built on July 4, 2023, 11:17 p.m.