Repository navigation
Use lt 0.5 selectors for the summary table spanners - #385
Merged
Merged
Conversation
Spanners select their columns with predicates and lt_label() takes a named vector, so the hand-ordered column vectors are no longer needed. The rendered HTML is unchanged.
algoria-contributions
force-pushed
the
issue-373-lt-selectors
branch
from
November 30, 2026 10:15
1b2c59e to
efef347
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
yihui
approved these changes
Nov 30, 2026
yihui
left a comment
Collaborator
There was a problem hiding this comment.
Thanks! Just a minor comment.
Comment on lines
+154
to
+156
| lt::lt_spanner(label = "Time", columns = ~endsWith(., "_time")) |> | ||
| lt::lt_spanner(label = "Events", columns = ~endsWith(., "_event")) |> | ||
| lt::lt_spanner(label = "N", columns = ~endsWith(., "_n")) |> |
Collaborator
There was a problem hiding this comment.
How about the terse syntax?
Suggested change
| lt::lt_spanner(label = "Time", columns = ~endsWith(., "_time")) |> | |
| lt::lt_spanner(label = "Events", columns = ~endsWith(., "_event")) |> | |
| lt::lt_spanner(label = "N", columns = ~endsWith(., "_n")) |> | |
| lt::lt_spanner(Time ~ endsWith(., "_time")) |> | |
| lt::lt_spanner(Events ~ endsWith(., "_event")) |> | |
| lt::lt_spanner(N ~ endsWith(., "_n")) |> |
Contributor
Author
|
Thanks! The terse form fails with lt 0.5 and main when the RHS is a predicate ( |
yihui
approved these changes
Dec 1, 2026
yihui
left a comment
Collaborator
There was a problem hiding this comment.
Oh I didn't realize that. Thanks for yihui/lt#75!
Let's merge this PR for now.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #373.
lt 0.5 has predicate selectors and puts spanner columns in body order, so
R/lt.Rno longer needs its hand-ordered column vectors.~endsWith(., "_time").lt_label()takesstats::setNames(labels, names(x))instead of thedo.call()splice.DESCRIPTIONrequireslt (>= 0.5).The vignette item no longer applies: the vignette already renders
fr |> lt()withoutlt_format().lt_move()still lists its columns to keep each asymptotic/simulated pair together; a predicate would follownames(x)and change the table. Happy to switch if you prefer that layout.The rendered HTML is identical to
mainfor one-sided, two-sided, no-design and unsummarised inputs. Tests andR CMD check --as-crangive the same results asmain.Algoria