Skip to content

Pass response to bayestestR::bayesian_as_frequentist() in check_model() - #984

Merged
strengejacke merged 3 commits into
easystats:mainfrom
jmgirard:bayestestr-response-argument
Oct 18, 2026
Merged

strengejacke merged 3 commits into
easystats:mainfrom
jmgirard:bayestestr-response-argument

Conversation

@jmgirard

Copy link
Copy Markdown
Contributor

bayestestR renamed the resp argument of bayesian_as_frequentist() to response in easystats/bayestestR#790 (version 0.20.0.1), with no alias. check_model() still passed resp = resp for multivariate brms models. That call works only by partial matching, so with options(warnPartialMatchArgs = TRUE) it warns "partial argument match of 'resp' to 'response'".

What changes

  • check_model() passes response = resp when bayestestR::bayesian_as_frequentist() has a response argument, and resp = resp otherwise. CRAN's bayestestR 0.20.0 still has resp, and Prepare CRAN release #980 lowers the minimum to 0.19.0, so this PR does not change the bayestestR minimum or Remotes.
  • No NEWS entry, because multivariate brms support is new in this devel cycle (support for multivariate models #908) and no released version had the warning. The dev version is bumped.

Tests

  • A mock with a response argument and a mock with a resp argument each receive their own argument name and the value. The names are read with sys.call(), so a partial match of resp to response makes the test fail. The existing function(...) mock now also checks that it gets no response.
  • With bayestestR 0.20.0.1 installed, a real conversion of brms_mv_1 under warnPartialMatchArgs = TRUE gives the frequentist panels and no partial-match warning. The test is skipped when the installed bayestestR has no response argument.

On main, the response mock and the real-conversion test fail. With bayestestR 0.20.0.1 installed locally, the full suite gives no failure, and R CMD check gives no error or warning.

…that argument

bayestestR renamed `resp` to `response` (easystats/bayestestR#790). Passing
`resp` still worked by partial matching but warned under
options(warnPartialMatchArgs = TRUE). Older bayestestR versions still get `resp`.
Multivariate brms support is new in this devel cycle, so no released version
had the partial-match warning.

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.

🟢 Approval recommended

All reviewed changes are covered by tests and no blocking issues were identified.

No open issues 🎉

What changed in this PR

Updates check_model() to support both old and new bayestestR response argument names without partial-match warnings.

Changes:

  • Selects response or legacy resp based on package support.
  • Adds compatibility and regression tests.
  • Bumps the development version.
File Description
tests/​testthat/​test-check_model.R Tests argument compatibility and warning-free conversion.
R/​check_model.R Selects the compatible response argument.
DESCRIPTION Bumps the package version.

Review effort: Lite

@strengejacke
strengejacke merged commit 1b1f15f into easystats:main Oct 18, 2026
9 of 20 checks passed
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.

3 participants