stan-dev / stan-dev/bayesplot

Replace superseded coord_flip() with swapped aesthetics in ppc_error_scatter_avg

Open Beginner friendly
#476 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
442
Forks
93
Avg merge
3h 11m
Merged PRs (30d)
1

Description

ppc_error_scatter_avg() and the deprecated ppc_error_scatter_avg_vs_x() in R/ppc-errors.R use coord_flip(), which is marked as [Superseded] in ggplot2.

From the ggplot2 docs:

This function is superseded because in many cases, coord_flip() can easily be replaced by swapping the x and y aesthetics, or optionally setting the orientation argument in geom and stat layers.

https://ggplot2.tidyverse.org/reference/coord_flip.html

Two call sites at lines 260 and 330 of R/ppc-errors.R.

Would it be welcome to replace these with swapped aesthetics? Happy to open a PR if so.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in R/ppc-errors.R at the two coord_flip() call sites around lines 260 and 330, within ppc_error_scatter_avg() and the deprecated ppc_error_scatter_avg_vs_x(). Review the existing aesthetics and ggplot2 guidance on replacing coord_flip() with swapped aesthetics. Done means both call sites no longer use the superseded function while preserving the plots' intended orientation; run the package tests or relevant plotting checks.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data-visualization
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.