Skip to content

Use tbl_listing() for the individual subject deaths listing - #357

Open
Melkiades wants to merge 6 commits into
mainfrom
listing-tbl-listing
Open

Use tbl_listing() for the individual subject deaths listing#357
Melkiades wants to merge 6 commits into
mainfrom
listing-tbl-listing

Conversation

@Melkiades

@Melkiades Melkiades commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

GitHub Issue

Closes #354

Summary

FDA Table 9 (all individual subject deaths) is a subject-level listing, not an aggregated summary. It was built with gtsummary::as_gtsummary(), which returns a generic table. crane::tbl_listing() is the purpose-built constructor for listings and classes the object as such, while remaining a gtsummary so the existing modify_header()/modify_column_alignment() calls are unchanged.

  • test-fda-table_09: build tbl with crane::tbl_listing()
  • catalog index.qmd: same swap for the published template

Why only Table 9?

It is fair to ask whether more templates should use tbl_listing(). I checked every template against the FDA Standard Safety Tables and Figures Integrated Guide (2025), which is the source for our catalog.

The guide defines 60 numbered "Table" items, but 6 of them are actually subject-level listings (titled "Listing of ..." or "All Individual Subject ..."): Tables 9, 39, 41, 42, 54 and 55. The rest are aggregated summaries (n/%, mean/SD, risk difference, etc.).

Of those 6 listings, only Table 9 exists in our catalog today. Tables 39, 41, 42, 54 and 55 are not implemented yet, so there is nothing to convert. Every other implemented template (02, 03, 04, 06, 07, 08, 10-18, 29, 33-38, 43-45, 50, 51) is a summary built on tbl_summary/tbl_hierarchical/tbl_ard_summary, so tbl_listing() does not apply.

So Table 9 is the only listing to switch right now. When Tables 39/41/42/54/55 are added, they should use tbl_listing() too.

Snapshot unchanged

The snapshot captures the underlying data frame (as.data.frame(data)), which is untouched, so output is identical. Test passes locally.

Melkiades and others added 6 commits August 20, 2026 08:49
FDA Table 9 is a subject-level listing, not an aggregated summary. It
was built with gtsummary::as_gtsummary(), which returns a generic table.
crane::tbl_listing() is the purpose-built constructor for listings and
returns an object classed as such, while remaining a gtsummary so the
existing modify_header()/modify_column_alignment() calls are unchanged.

The snapshot captures the underlying data frame, which is untouched, so
output is identical.

- test-fda-table_09: build tbl with crane::tbl_listing()
- catalog index.qmd: same swap for the published template
Per the FDA IG, Table 9 is a subject-level listing. Note the other IG
listings (39, 41, 42, 54, 55) that are not yet in the catalog.
@Melkiades
Melkiades marked this pull request as ready for review September 1, 2026 08:41
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Unit Tests Summary

 1 files  28 suites   21s ⏱️
28 tests 28 ✅ 0 💤 0 ❌
48 runs  48 ✅ 0 💤 0 ❌

Results for commit fa0a2d4.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

badge

Code Coverage Summary

Filename            Stmts    Miss  Cover    Missing
----------------  -------  ------  -------  ---------
R/fda-table_02.R       25       1  96.00%   77
R/run_template.R        5       1  80.00%   33
R/utils.R              40      40  0.00%    13-102
TOTAL                  70      42  40.00%

Diff against main

Filename      Stmts    Miss  Cover
----------  -------  ------  --------
TOTAL             0       0  +100.00%

Results for commit: fa0a2d4

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

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

Labels

None yet

2 participants