Fix #431: Replace deprecated dplyr/tidyselect functions#448
Fix #431: Replace deprecated dplyr/tidyselect functions#448jgabry merged 5 commits intostan-dev:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates bayesplot’s MCMC interval/area data helpers to avoid deprecated dplyr/tidyselect APIs (per the dplyr 1.0.0 lifecycle changes), reducing warnings and improving forward compatibility.
Changes:
- Replaced
one_of()selections withall_of(). - Replaced
top_n()withslice_min()for closest-density selection. - Refactored grouped-index splitting away from
group_indices(group_df)togroup_split()+group_keys(), and documented the change inNEWS.md.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| R/mcmc-intervals.R | Modernizes deprecated selection/ranking/grouping code paths used by mcmc_*_data() helpers. |
| NEWS.md | Adds a development-news bullet noting the deprecation replacements for #431. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #448 +/- ##
==========================================
- Coverage 98.63% 98.55% -0.09%
==========================================
Files 35 35
Lines 5860 5864 +4
==========================================
- Hits 5780 5779 -1
- Misses 80 85 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
That function is also used in mcmc_dens_chains() even though it's not defined in the same R file
jgabry
left a comment
There was a problem hiding this comment.
I added one more new test. I think this is now ready.
Fixes #431
This PR replaces deprecated functions from
dplyrandtidyselect(dating back to the dplyr 1.0.0 lifecycle changes) to ensure future compatibility and suppress warnings during checks.Changes made
top_n()withslice_min().one_of()withall_of().group_indices()logic to use modern equivalents (group_keys()andgroup_split()), asgroup_indices()is deprecated when passed a grouped data frame.