review_quality_ctrl {eHDPrep}R Documentation

Review Quality Control

Description

Provides information on modifications made to a dataset at both variable (column) and value (sample) levels, designed for review of quality control measures.

Usage

review_quality_ctrl(before_tbl, after_tbl, id_var)

Arguments

before_tbl

Data frame from before modifications were made.

after_tbl

Data frame from after modifications were made.

id_var

An unquoted expression which corresponds to a variable in both before_tbl and after_tbl which identifies each row. Required.

Details

Modifications are identified by comparing the original and modified dataset.

QC review functions are applied in the following order:

  1. Variable-level modifications (report_var_mods)

  2. Value-level modifications (mod_track)

  3. Value-level modifications (plot) (mod_track)

A list containing each of these functions' outputs is returned.

Value

List containing data for review of quality control

See Also

Other high level functionality: apply_quality_ctrl(), assess_quality(), semantic_enrichment()

Examples

data(example_data)
require(tibble)

tibble::tribble(~"var", ~"datatype",
"patient_id", "id",
"tumoursize", "numeric",
"t_stage", "ordinal_tstage",
"n_stage", "ordinal_nstage",
"diabetes", "factor",
"diabetes_type", "ordinal",
"hypertension", "factor",
"rural_urban", "factor",
"marital_status", "factor",
"SNP_a", "genotype",
"SNP_b", "genotype",
"free_text", "freetext") -> data_types

   
# create QC'ed dataset
post_QC_example_data <- apply_quality_ctrl(example_data,
                                           patient_id,
                                           data_types,
                                           bin_cats =c("No" = "Yes",
                                                       "rural" = "urban"),
                                           min_freq = 0.6)

# review QC
QC_review <- review_quality_ctrl(before_tbl = example_data,
                    after_tbl = post_QC_example_data,
                    id_var = patient_id)

# view variable level changes
QC_review$variable_level_changes

# view value level changes
QC_review$value_level_changes

# view value level changes as a plot
QC_review$value_level_changes_plt


[Package eHDPrep version 1.3.3 Index]