Skip to content

Document batch TLF generation with meta_run() - #269

Open
LittleBeannie wants to merge 3 commits into
mainfrom
268-add-a-vignette-showing-the-application-of-metadatameta_run-when-there-are-multiple-analysis-plans-defined-in-a-single-metadata
Open

LittleBeannie wants to merge 3 commits into
mainfrom
268-add-a-vignette-showing-the-application-of-metadatameta_run-when-there-are-multiple-analysis-plans-defined-in-a-single-metadata

Conversation

@LittleBeannie

Copy link
Copy Markdown
Collaborator

Summary

Extend the multiple-table vignette to demonstrate generating multiple TLFs from a single metadata object using metalite::meta_run().

Closes #268.

Changes

  • Distinguish individual TLF generation from batch TLF generation.
  • Define wrapper functions matching the analysis names in meta$plan.
  • Demonstrate generating and displaying all four outputs in one batch: an AE summary table, an AE-specific table, an interactive AE listing, and an interactive AE forest plot.
  • Explain how batch generation uses the parameters specified in each analysis plan.
  • Show how to execute selected plans using the i argument.
  • Use ae_forest_plot as the forest plot analysis name to distinguish it from the forestly::ae_forestly() renderer.

Validation

  • Successfully rendered the complete updated vignette against the package source.
  • Verified that batch execution returns all four outputs in analysis-plan order.
  • Verified that i = c(1, 2) returns the two static tables.

Documentation only; no package API changes.

@yihui yihui left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the vignette extension. Two correctness/consistency issues and one cleanup, details inline or below.

Needs a fix (line 243, outside the diff so not inline)

Approach 1 forest plot ignores the plan: prepare_ae_forestly() with no arguments falls back to all parameters (any, drug-related, serious), while the batch output 4 uses only drug-related;serious. It also makes the "explicitly selects its population, observation, and parameters" sentence (line 165) untrue for this pipeline. Suggested change to lines 242-245:

meta |>
  prepare_ae_forestly(
    population = "apat",
    observation = "apat",
    parameter = "drug-related;serious"
  ) |>
  format_ae_forestly() |>
  ae_forestly()

Inline suggestions

  • ## Approach 2 should be ### to match ### Approach 1 under ## TLF generation.
  • The original ## Summary closing section was dropped; suggest restoring it.

Not inline-suggestable

  • Each pipeline now appears twice (Approach 1 chunks and the Approach 2 wrappers), so the two copies can drift (e.g. meddra_version, default_page_size, source). Consider defining the wrappers once up front and having Approach 1 call them with explicit arguments, e.g. ae_summary(meta, "apat", "apat", "any;drug-related"), or add a sentence noting the wrappers intentionally mirror Approach 1 and must be kept in sync. Fine to keep the current form if the side-by-side pipeline is the teaching goal.

LittleBeannie and others added 2 commits November 5, 2026 12:05
Co-authored-by: Yihui Xie <xie@yihui.name>
Co-authored-by: Yihui Xie <xie@yihui.name>
@LittleBeannie
LittleBeannie requested a review from yihui November 5, 2026 19:31
@@ -231,9 +245,103 @@ meta |>
ae_forestly()

@yihui yihui Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this call needs the same arguments as the batch wrapper, or the two outputs differ.

prepare_ae_forestly() with no parameter falls back to every parameter in meta (any, drug-related, serious). Plan 4 (line 100) and batch output 4 use only drug-related;serious, so this plot shows an extra parameter.

Line 243 should read:

prepare_ae_forestly(
  population = "apat",
  observation = "apat",
  parameter = "drug-related;serious"
) |>

This also makes the sentence above ("explicitly selects its population, observation, and parameters") true for this pipeline. population and observation are optional here since there is one of each, but they match the other three pipelines.

Or the comment on line 100 was wrong?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a vignette showing the application of metadata::meta_run() when there are multiple analysis plans defined in a single metadata

2 participants