Skip to content

Post-processing no longer prints redundant labels - #663

Merged
strengejacke merged 3 commits into
mainfrom
remove_redundant_labels
Sep 11, 2026
Merged

Post-processing no longer prints redundant labels#663
strengejacke merged 3 commits into
mainfrom
remove_redundant_labels

Conversation

@strengejacke

@strengejacke strengejacke commented Sep 11, 2026

Copy link
Copy Markdown
Member

This code

  data(efc, package = "modelbased")
  efc <- datawizard::to_factor(efc, c("c161sex", "c172code", "e16sex", "e42dep"))
  levels(efc$c172code) <- c("low", "mid", "high")
  m <- lm(neg_c_7 ~ barthtot + c172code * e42dep * c161sex, data = efc)

  out <- estimate_contrasts(
    m,
    "c161sex",
    by = c("c172code", "e42dep"),
    estimate = "average",
    post_process = ~ pairwise | e42dep
  )

used to include levels from the grouping-variable e42dep in the Parameters column, where the levels of comparisons were saved (i.e. the levels of e42dep appeared in two columns). This redundant information is now removed, to clean the output.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Two moderate post_process parsing issues remain unresolved.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This pull request removes redundant grouping-variable labels from post-processed contrast parameters.

Changes:

  • Updates post-processing label generation.
  • Adds regression coverage.
  • Updates NEWS and development version.

Review findings:

  • R/get_marginalmeans.R: Two moderate issues remain with character-string and function post_process parsing (1 and 2 votes).
  • NEWS.md: Nit regarding a missing space (3 votes).
File summaries
File Summary
tests/testthat/test-estimate_contrasts.R Adds regression coverage for expected parameter labels.
R/get_marginalmeans.R Adjusts post-processing label generation; parsing issues remain unresolved.
NEWS.md Documents the output change.
DESCRIPTION Bumps the development version.
Review details

Suppressed comments (1)

R/get_marginalmeans.R:410

  • post_process is documented as accepting character strings, but safe_deparse() quotes a character input. With post_process = "pairwise | e42dep", the extracted group becomes e42dep\", so all.vars() finds no matching column and the redundant group labels remain; parse character inputs directly (or normalize them before deparsing).
        strsplit(insight::safe_deparse(post_process), "|", fixed = TRUE),
  • Files reviewed: 4/4 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread R/get_marginalmeans.R Outdated
Comment thread NEWS.md Outdated
strengejacke and others added 2 commits September 11, 2026 12:19
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@strengejacke
strengejacke merged commit 927a884 into main Sep 11, 2026
12 of 20 checks passed
@strengejacke
strengejacke deleted the remove_redundant_labels branch September 11, 2026 10:22
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