Repository navigation
format_table(): show the CI level in the column name for select - #1306
Conversation
| Package: insight | ||
| Title: Easy Access to Model Information for Various Model Objects | ||
| Version: 1.7.0 | ||
| Version: 1.7.1 |
There was a problem hiding this comment.
That's a bit high ;-)
Increase / add at fourth digit: 1.7.0.1
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
2 open issues
What changed in this PR
Updates format_table() so CI selections/patterns reflect the CI level in the rendered column header (e.g., Coefficient (95% CI)), and adjusts tests/docs accordingly.
Changes:
- Pass CI column name(s) into the glue/pattern naming helper so
{ci}can render with the appropriate level. - Update existing test expectations and add new tests covering CI-level header behavior (including multi-level and unknown-level cases).
- Document the change and bump package version.
| File | Description |
|---|---|
| tests/testthat/test-format_table_ci.R | Adds new tests asserting CI level appears in column headers for select = "ci" and {ci} patterns. |
| tests/testthat/test-format_table.R | Updates snapshot expectations for CI column headers to include 95% where applicable. |
| R/format_table_glue.R | Extends .style_pattern_to_name() to use CI column name (with level) when replacing {ci}. |
| NEWS.md | Documents updated header behavior for CI selections/patterns. |
| DESCRIPTION | Bumps package version to 1.7.0.1. |
Review effort: Lite
|
I went through Copilot's review and left both notes as they are. The |

Fixes #1300
format_table()withselect = "ci"or a{ci}pattern always wrote "CI" in the column name, although the CI column's name already holds the level. The column name now uses that name, soprint(x, select = "ci")andprint(x, select = "{estimate} ({ci})")both showCoefficient (95% CI). If the level isn't known (a plainCIorconf.intcolumn), the name staysCI.With two levels,
select = "ci"still shows only the first one, as it did before. The column name now says which one it is, for exampleCoefficient (80% CI).This changes expected output in two other packages, and those tests need updating once this is merged:
_snaps/compare_parameters.mdand 3[CI]headers in the "select pattern" test intest-printing.R_snaps/print.md(test-print.Ronly runs on Windows)Only the header lines and the column widths change. I ran the parameters, modelbased and report tests against this branch, and report isn't affected.