| generate_cdisc_report | R Documentation |
Generates a formatted report from the results of cdisc_compare(). Supports both
text-based console output and HTML reports with professional styling and color-coding.
generate_cdisc_report(cdisc_results, output_format = "text", file_name = NULL)
cdisc_results |
A list output from |
output_format |
Character string: either "text" (default) for console output or "html" for HTML report. |
file_name |
Optional character string specifying the output file path. For text format, the report is appended to this file. For HTML format, must be explicitly provided by the user. If NULL, output is not written to file. |
The report includes:
Dataset Comparison Summary
CDISC Compliance for each dataset
CDISC Conformance Comparison
For text output, formatting uses console-friendly layout. For HTML output, a self-contained report is generated with color-coded severity levels: red for ERROR, orange for WARNING, blue for INFO.
Invisibly returns the input cdisc_results (useful for piping).
## Not run:
# Create sample datasets
dm1 <- data.frame(
STUDYID = "STUDY001",
USUBJID = c("SUBJ001", "SUBJ002"),
DMSEQ = c(1, 1),
RACE = c("WHITE", "BLACK OR AFRICAN AMERICAN")
)
dm2 <- data.frame(
STUDYID = "STUDY001",
USUBJID = c("SUBJ001", "SUBJ003"),
DMSEQ = c(1, 1),
RACE = c("WHITE", "ASIAN")
)
result <- cdisc_compare(dm1, dm2, domain = "DM")
# Generate text report to console
generate_cdisc_report(result, output_format = "text")
# Generate HTML report to file
out <- file.path(tempdir(), "report.html")
generate_cdisc_report(result, output_format = "html", file_name = out)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.