Skip to content

Replace gt with lt for table output - #282

Open
yihui wants to merge 11 commits into
GitHub/3.11.0-releasefrom
replace-gt-with-lt
Open

Replace gt with lt for table output#282
yihui wants to merge 11 commits into
GitHub/3.11.0-releasefrom
replace-gt-with-lt

Conversation

@yihui

@yihui yihui commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Replace the gt package dependency with the lightweight lt package for all table output, mirroring Merck/gsDesign2#629.

Changes

  • Add lt.gsBinomialExactTable() S3 method (R/as_lt.R); deprecate as_gt() in favor of lt::lt().
  • Swap gt for lt in DESCRIPTION Imports.
  • Migrate all table-bearing vignettes to lt, dropping the bundled html_vignette CSS in favor of a minimal vignettes/vignette.css.
  • Update tests, docs, and _pkgdown.yml.

Side-by-side comparison of vignettes rendered via gt vs lt

Download and unzip: vignette-compare.zip

Replace the gt package dependency with the lightweight lt package for all
table output, mirroring Merck/gsDesign2#629.

- Add lt.gsBinomialExactTable() S3 method (R/as_lt.R) and deprecate as_gt()
  in favor of lt::lt().
- Swap gt for lt in DESCRIPTION Imports; add Remotes: yihui/lt pending the
  next lt release on CRAN.
- Migrate all table-bearing vignettes to lt, dropping the bundled
  html_vignette CSS in favor of a minimal vignettes/vignette.css.
- Update tests, docs, and _pkgdown.yml accordingly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@yihui
yihui marked this pull request as ready for review August 20, 2026 01:30
yihui and others added 2 commits August 21, 2026 16:37
Keep as_gt() returning a gt_tbl for one release so existing code that
customizes the output with gt functions keeps working. The generic now
emits a deprecation warning pointing to lt::lt(), then dispatches to the
restored gt-based method, which guards on gt being installed (gt moved
to Suggests).

Also re-export the lt() generic so lt() can be called on a summary table
after loading only gsDesign, with robust S3 dispatch regardless of
package load order.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@jdblischak jdblischak 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.

Need to remove unnecessary lt:: now that the generic is re-exported. I highlighted most of them. And no need to accept my individual suggestions if you'd prefer to do the update in a single commit.

Comment thread R/as_gt.R Outdated
Comment thread R/as_gt.R Outdated
Comment thread R/as_gt.R Outdated
Comment thread R/as_lt.R Outdated
Comment thread R/as_table.R Outdated
Comment thread vignettes/binomialTwoSample.Rmd Outdated
Comment thread NEWS.md Outdated
Co-authored-by: John Blischak <jdblischak@gmail.com>
Comment thread vignettes/binomialTwoSample.Rmd Outdated
Comment thread vignettes/binomialTwoSample.Rmd Outdated
Co-authored-by: Yihui Xie <xie@yihui.name>
Comment thread man/lt-methods.Rd Outdated
Comment thread vignettes/binomialSPRTExample.Rmd Outdated
Comment thread vignettes/binomialSPRTExample.Rmd Outdated
@yihui
yihui changed the base branch from master to GitHub/3.11.0-release August 26, 2026 20:06
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.

2 participants