TLG
Overview
This section demonstrates how to create Tables, Listings, and Graphs (TLGs) for clinical study reporting using pharmaverse packages. TLGs are essential components of clinical study reports and regulatory submissions, providing clear presentation of study results.
The examples showcase two distinct approaches for generating publication-quality outputs, working with ADaM datasets as input.
Which Approach Should I Use?
Analysis Results Datasets (ARDs) 🆕
Best for:
- Organizations implementing the CDISC Analysis Results Standard
- Teams wanting reusable, structured analysis results
- Projects requiring multiple output formats from the same statistics
- Regulatory submissions emphasizing data standardization and traceability
- Separating statistical computation from table formatting
Packages: {cards}, {tfrmt}, {gtsummary}
Workflow: Data → ARD (structured statistics) → Formatted Table
Classic Direct Summarization 📊
Best for:
- Quick ad-hoc analyses and exploratory work
- Teams familiar with traditional R table packages
- Complex nested layouts requiring fine-grained control
- Existing workflows using
{rtables}/{tern} - Single-purpose table generation
Packages: {rtables}, {tern}
Workflow: Data → Formatted Table (single step)
Both approaches produce publication-quality outputs - the choice depends on your workflow and organizational standards. ARDs represent the emerging standard for structured analysis results, while the classic approach offers a mature, stable ecosystem with extensive layout capabilities.
Examples by Approach
Using Analysis Results Datasets (ARDs)
These examples leverage the CDISC Analysis Results Standard, creating structured ARDs first using {cards}, then formatting them into tables. This two-step approach promotes reusability, standardization, and separation of statistical computation from presentation.
Demographic Tables
- {cards} + {gtsummary} - Build demographics from ARDs with bidirectional workflow (ARD → Table or Table → ARD)
- {cards} + {tfrmt} - Create highly customized demographic tables from ARDs
Adverse Events Tables
- {cards} + {tfrmt} - Generate AE summaries with hierarchical organization and custom formatting
Classic Direct Summarization
These examples create tables directly from analysis datasets using the traditional single-step approach with {rtables} and {tern}.
Demographic Tables
- {rtables} + {tern} - Comprehensive demographic and baseline characteristics summaries
Adverse Events Tables
- {rtables} + {tern} - AE summaries with frequency counts, percentages, and system organ class groupings
Listings & Graphs
- Pharmacokinetic Outputs - Concentration-time graphs and parameter summaries
Quick Reference Table
| Table Type | ARD Approach | Classic Approach |
|---|---|---|
| Demographics | {cards} + {gtsummary} {cards} + {tfrmt} |
{rtables} + {tern} |
| Adverse Events | {cards} + {tfrmt} | {rtables} + {tern} |
| PK Outputs | Coming soon | View example |
Key Packages Used
ARD Ecosystem
{cards}- Create and manipulate Analysis Results Datasets following CDISC standards{tfrmt}- Transform ARDs into publication-ready tables with precise formatting control{gtsummary}- Generate listings or summary tables (with or without ARDs) with support for multiple output formats
Classic Ecosystem
{rlistings}- Create regulatory ready listings for health authority review{rtables}- Create complex tables with flexible layouts and nested structures{tern}- Analysis and reporting functions specifically designed for clinical trials
Graphics
{ggplot2}- Publication-quality graphics for all approaches
What Each Example Includes
All examples provide complete, reproducible code with:
- Data preprocessing and preparation steps
- Summary statistics calculation
- Table or graph generation with detailed explanations
- Formatting and styling for publication-ready output
- Comments and best practices
All examples use ADaM datasets from {pharmaverseadam} as input, ensuring consistency and reproducibility.
Learn More
- CDISC Analysis Results Standard - Official standard documentation
- {cards} package documentation - Learn more about creating ARDs
- {gtsummary} package documentation - Learn more about creating summary tables
- {tfrmt} package documentation - Advanced table formatting with ARDs
- {rtables} package documentation - Comprehensive table creation guide