Add regression tests for reformulate formula edge cases #514
+45
−1
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.
This PR addresses issue #391 where
report()was failing when models were built usingstats::reformulate.Analysis: The issue appears to have been resolved in recent versions (current: 0.6.1.3 vs reported: 0.5.7), but there were no regression tests to prevent this issue from reoccurring.
Changes made:
tests/testthat/test-report.lm.RReformulate scenarios now tested:
reformulate(c("wt", "hp"), "mpg")reformulate(c("wt", "hp", "wt:hp"), "mpg")formula(reformulate(...))reformulate(..., intercept = FALSE)format_formula()andreport_model()Demonstration that the fix works:
All 14 new regression tests pass successfully, ensuring that models built with
reformulate()work identically to models built with standard formula syntax.Fixes #391.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/easystats/insight/commits/HEAD/usr/lib/R/bin/exec/R --no-restore --no-save -e devtools::install_github(c("easystats/insight",~+~"easystats/bayestestR",~+~"easystats/parameters",~+~"easystats/performance",~+~"easystats/effectsize",~+~"easystats/datawizard"))(http block)https://r-universe.dev/src/contrib/PACKAGES/usr/lib/R/bin/exec/R --no-restore --no-save -e install.packages(c("insight",~+~"bayestestR",~+~"effectsize",~+~"performance",~+~"parameters",~+~"datawizard",~+~"styler"),~+~repos=c("REDACTED",~+~"REDACTED"))(http block)https://r-universe.dev/src/contrib/PACKAGES.gz/usr/lib/R/bin/exec/R --no-restore --no-save -e install.packages(c("insight",~+~"bayestestR",~+~"effectsize",~+~"performance",~+~"parameters",~+~"datawizard",~+~"styler"),~+~repos=c("REDACTED",~+~"REDACTED"))(http block)https://r-universe.dev/src/contrib/PACKAGES.rds/usr/lib/R/bin/exec/R --no-restore --no-save -e install.packages(c("insight",~+~"bayestestR",~+~"effectsize",~+~"performance",~+~"parameters",~+~"datawizard",~+~"styler"),~+~repos=c("REDACTED",~+~"REDACTED"))(http block)If you need me to access, download, or install something from one of these locations, you can either:
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.