Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Follow recommended practice for using ggplot2::aes() in packages #124

Merged
merged 1 commit into from Feb 9, 2024

Conversation

jdblischak
Copy link
Contributor

I updated the use of ggplot2::aes() to follow the best practice recommendations from the ggplot2 maintainers in their vignette Using ggplot2 in packages:

If you know the mapping or facet specification is col in advance, use aes(.data$col) or vars(.data$col).

You will see a lot of other ways to do this in the wild, but the syntax we use here is the only one we can guarantee will work in the future!

Trying to find the minimum required version of {ggplot2} to support the current best practice required some trial and error. Support for tidy evaluation was first added in version 3.0.0 in July 2019 (CRAN archives). However, the test suite failed with this version. By binary searching through the potential versions, I determined that version 3.1.1 is the minimum required version. It's a patch release from April 2019 that for some reason doesn't have its own NEWS entry. The test suite passes with the version, with the minor exception that a few of the snapshot tests fail because the order of the legends is reversed (ie only the display, and not the actual content, was affected).

@keaven keaven merged commit 3a8c6bc into keaven:master Feb 9, 2024
9 checks passed
@jdblischak jdblischak deleted the ggplot2-aes branch February 9, 2024 17:55
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.

None yet

2 participants