Unified wrapper functions for bayesplot families
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 442
- Forks
- 93
- Avg merge
- 3h 11m
- Merged PRs (30d)
- 1
Description
Summary
Currently, each plot family in bayesplot exposes several closely related functions that share common inputs but differ in specific behaviors. For example, the error family within the PPC module includes:
ppc_error_hist()ppc_error_hist_grouped()ppc_error_scatter()ppc_error_binned()- ...
Exposing all these individual functions in the documentation can make it difficult for users to navigate the package. To improve usability, I would propose providing a wrapper function for each family that consolidates these related functions into a single "general concept".
Proposed Change
Introduce a high-level wrapper for each family that dispatches to the underlying functions via a type argument. Below is an example of the intended structure (subject to further refinement):
ppc_error <- function(
y,
yrep,
type = c("hist", "scatter", "scatter_avg", "scatter_avg_vs_x", "binned"),
group = NULL,
x = NULL,
grouped = FALSE,
...
)
We could implement a similar pattern for other families. This approach would result in a more organized API and more compact documentation pages.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the existing PPC entry points, including ppc_error_hist(), ppc_error_hist_grouped(), ppc_error_scatter(), and ppc_error_binned(), then compare how other bayesplot families are organized. Define the wrapper scope and type-dispatch behavior before consolidating the related functions and documentation; done means the agreed families have a coherent API without losing their existing behaviors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100