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
|
Details
Modifications are identified by comparing the original and modified dataset.
QC review functions are applied in the following order:
Variable-level modifications (
report_var_mods
)Value-level modifications (
mod_track
)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