etl_qa_export_results: Export tables and graphs of ETL QA pipeline results

View source: R/etl_qa_run_pipeline.R

etl_qa_export_resultsR Documentation

Export tables and graphs of ETL QA pipeline results

Description

This function exports Excel tables and PDF plots of ETL QA results. It is the fourth and final step run by etl_qa_run_pipeline.

Usage

etl_qa_export_results(qa_results, config)

Arguments

qa_results

A list containing the processed QA results from etl_qa_final_results()

config

An S3 object of class "qa_data_config" containing configuration settings.

Details

This is an internal function accessible only by use of :::, for example, apde:::etl_qa_export_results(...).

Value

A list the file paths for the exported data:

pdf_missing

File path to PDF of plots of data missingness over time

pdf_values

File path to PDF of plots of frequency and statistical changes over time

excel

File path to Excel file with tabs for missingness, values, CHI comparisons

Examples

## Not run: 

# Step 1: generate a config object 
myconfig <- etl_qa_setup_config(
  data_source_type = 'rads',
  data_params = list(
    function_name = 'get_data_birth',
    time_var = 'chi_year',
    time_range = c(2021, 2022),
    cols = c('chi_age', 'race4', 'birth_weight_grams', 'birthplace_city', 
             'num_prev_cesarean', 'mother_date_of_birth'),
    version = 'final', 
    kingco = FALSE, 
    check_chi = TRUE
  ), 
  output_directory = 'C:/temp/'
)

# Step 2: prep the initial results
initial_results <- etl_qa_initial_results(config = myconfig)

# Step 3: prep the final results
final_results <- etl_qa_final_results(initial_qa_results = initial_results, 
                                      config = myconfig)

# Step 4: Export tables and visualizations
etl_qa_export_results(qa_results = final_results, config = myconfig)


## End(Not run)


PHSKC-APDE/apde documentation built on April 14, 2025, 10:46 a.m.