Overview
The cuci package can generate HTML audit reports summarizing the results of a column-matching workflow.
The report is created using the bundled Quarto template and the matching log files produced during the workflow pipeline.
The main function to generate report is:
cuci::render_report()A successful rendering requires a log directory containing the master
matching log file that is created automatically during data cleaning
with run_pipeline():
match_log_MASTER.csv
Requirements
Report rendering requires a working installation of Quarto.
The Quarto installation can be checked with:
quarto::quarto_version()If Quarto is not installed, download it from:
Basic usage
Assuming matching logs are stored in:
logs/matching/
and the directory contains:
logs/matching/
└── match_log_MASTER.csv
a report can be generated with:
library(cuci)
render_report(
log_dir = "logs/matching"
)The function returns the path to the generated HTML report.
report_path <- cuci::render_report(
log_dir = "logs/matching"
)
report_pathOutput location
By default, the report is saved in the user’s Documents
directory.
A custom output directory can be specified:
render_report(
log_dir = "logs/matching",
output_dir = "reports"
)If the directory does not exist, render_report() asks
for confirmation before creating it in an interactive session.
To create directories automatically:
render_report(
log_dir = "logs/matching",
output_dir = "reports",
create_dir = TRUE
)Custom filenames
The output filename can be specified using output_file
else use the default file naming with current date:
render_report(
log_dir = "logs/matching",
output_dir = "reports",
output_file = "audit_report.html"
)Automated workflows
For scripts or automated pipelines, disable browser opening and avoid interactive prompts:
render_report(
log_dir = "logs/matching",
output_dir = "reports",
output_file = "audit_report.html",
create_dir = TRUE,
open_browser = FALSE
)