Skip to content

Fix print() for Wiener/RT-choice estimates without a Component column - #681

Merged
strengejacke merged 6 commits into
mainfrom
copilot/fix-print-estimate-methods
Oct 15, 2026
Merged

strengejacke merged 6 commits into
mainfrom
copilot/fix-print-estimate-methods

Conversation

Copilot AI commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

For is_wiener / is_rtchoice models, every print() method went to .print_drift_diffusion(), which splits the table by Component. Only response predictions have that column, so printing estimates of a distributional parameter (predict = "mu", "bs") failed. .print_drift_diffusion() also failed when only one component was left, e.g. after subsetting.

m <- brm(bf(rt | dec(resp) ~ x), data = d, family = wiener())

estimate_means(m, by = "x", predict = "mu")        # previously: Error in `$<-.data.frame`
estimate_contrasts(m, contrast = "x", predict = "mu")
head(estimate_prediction(m), 2)                    # previously: Error in `x[[i]] <- value`

Changes

  • print.estimate_contrasts() (R/print.R)
    • The drift-diffusion branch now also requires a Component column. Tables without one use the regular formatting path.
    • The seven print methods that alias this function are fixed too.
  • .print_drift_diffusion() (R/print.R)
    • Dropping the other component's columns is skipped when setdiff(names(out), i) is empty. With a single component, out[[i]][[character(0)]] <- NULL threw an error.

No tests, NEWS.md entry or version bump are included yet.

Co-authored-by: DominiqueMakowski <8875533+DominiqueMakowski@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix print method for estimate means and contrasts Fix print() for Wiener/RT-choice estimates without a Component column Oct 14, 2026
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@DominiqueMakowski
DominiqueMakowski marked this pull request as ready for review October 14, 2026 20:54
Copilot AI balanced review requested due to automatic review settings October 14, 2026 20:54

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

Regression tests are missing for both corrected printing failures.

1 open finding
What changed in this PR

Fixes printing failures for Wiener and RT-choice estimates in the shared printer, addressing #680.

Changes:

  • Uses regular formatting when Component is absent.
  • Avoids invalid column removal when only one component remains.
File Description
R/​print.R Guards component-specific formatting and single-component column removal.

🧠 Review effort: Balanced


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

Comment thread R/print.R
Comment on lines +110 to +112
if (
(isTRUE(attr$model_info$is_wiener) || isTRUE(attr$model_info$is_rtchoice)) &&
"Component" %in% colnames(x)
@strengejacke
strengejacke merged commit dbdc141 into main Oct 15, 2026
10 of 19 checks passed
@strengejacke
strengejacke deleted the copilot/fix-print-estimate-methods branch October 15, 2026 09:23
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.

print() fails for estimate_means() / estimate_contrasts() on Wiener and RT-choice models

4 participants