Skip to contents

Compiles all provenance collected during the active session into a structured, self-contained HTML document suitable for inclusion in a regulatory submission package.

Usage

lg_report(
  format = "html",
  output = NULL,
  title = "Data Provenance Report",
  study_id = .lg$study_id,
  sponsor = NULL,
  author = NULL,
  date = Sys.Date()
)

Arguments

format

Character. Output format: "html" (default). PDF requires Quarto CLI and a LaTeX installation.

output

Character or NULL. Output file path. If NULL, returns the report as a character string (HTML) without writing to disk.

title

Character. Report title.

study_id

Character or NULL. Study identifier for the report header.

sponsor

Character or NULL. Sponsor name.

author

Character or NULL. Analyst name.

date

Date or Character. Report date. Defaults to today.

Value

The output file path (if output is specified) or the HTML string (if output is NULL), invisibly.

Details

The report covers:

  • Dataset inventory : all tagged datasets, row counts, sources

  • Subject disposition : CONSORT-style disposition table from all lg_filter() calls

  • Population flags : definitions, criteria, and counts for all lg_population() registrations

  • Variable derivations : SDTM-to-ADaM mappings from lg_spec() registrations

  • Operation log : full sequence of pipeline operations

  • Exclusion listing : every excluded subject with reason and population

Examples

if (FALSE) { # \dontrun{
lg_start(study_id = "TRIAL-001", analysis_id = "primary")

# ... tagging, filtering, deriving, spec registration ...

lg_report(
  output   = "outputs/lineage_report_TRIAL001.html",
  title    = "Data Provenance Report: TRIAL-001",
  sponsor  = "Example Pharma Ltd",
  author   = "Ndoh Penn, Biostatistician"
)
} # }