Modernize ggplot2 usage (remove deprecated aes_string/aes_) and tidy up examples #332
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.
Summary
This PR modernizes plotting code in the package by removing deprecated ggplot2 APIs and updating related imports and documentation. It replaces all uses of the deprecated aes_string() and aes_() helpers with tidy-eval friendly constructs (aes() + .data / .data[[...]]). A few small additional tidy-ups and example adjustments were made so the package builds and checks cleanly under current R/ggplot2 versions.
Why
R/ggplot2 emits lifecycle warnings for use of
aes_string()
/aes_()
which clutter user output and indicate deprecated usage. Updating to tidy-eval idioms prevents those warnings and keeps the codebase compatible with modern ggplot2 and rlang practices.What I changed
aes_string(...)
andaes_(...)
withaes()
and.data
indexing.aes_string
andaes_
imports fromNAMESPACE
and updated roxygen import tags where necessary.&
/|
usages in scalar conditional expressions with&&
/||
to follow best practices.gseDO()
/gseaplot()
in\donttest{}
so R CMD check is not slowed or fails due to long example runtime during automated checks.Files changed (high level)
Major edits were applied to the following R files (most changes are replacing aesthetic mappings):
I avoided changing plotting behavior or the public API; these edits are code modernization only.
Checks performed
R CMD check --as-cran
locally (with suggested packages available).NEWS.md
/ docs (recommend updating these links).Remotes
field and version format produce minor NOTES (version contains leading zeroes:1.29.2.003
) — optional to adjust.aes_string
oraes_
in the source via code search.How to test locally
How
After one script was fix, GPT5 used the new ducomentation to expand the fixes and check the full repo to identify issues with
R CMD check --as-cran
Notes and recommended follow-ups
NEWS.md
andDESCRIPTION
to remove 404s.\donttest{}
to runnable form when desired; they were wrapped to avoid long running examples on CRAN-style checks.R CMD check
with the same configuration as Bioconductor/CRAN to catch regressions early.Generated on: 2025-10-03 wiht GPT5