Skip to content

Conversation

ToledoEM
Copy link

@ToledoEM ToledoEM commented Oct 4, 2025

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

  • Replaced all occurrences of aes_string(...) and aes_(...) with aes() and .data indexing.
  • Removed aes_string and aes_ imports from NAMESPACE and updated roxygen import tags where necessary.
  • Replaced a few &/| usages in scalar conditional expressions with && / || to follow best practices.
  • Wrapped long-running examples that call gseDO() / gseaplot() in \donttest{} so R CMD check is not slowed or fails due to long example runtime during automated checks.
  • Minor comment adjustments and a few commented-out example lines updated to tidy-eval style.

Files changed (high level)

Major edits were applied to the following R files (most changes are replacing aesthetic mappings):

  • R/ridgeplot.R
  • R/dotplot.R
  • R/barplot.R
  • R/treeplot.R
  • R/densityplot.R
  • R/heatplot.R
  • R/gseaplot.R
  • R/pmcplot.R
  • R/upsetplot.R
  • R/emapplot_utilities.R
  • R/AllGenerics.R (examples wrapped in \donttest{})
  • NAMESPACE (removed aes_string / aes_ imports)

I avoided changing plotting behavior or the public API; these edits are code modernization only.

Checks performed

  • Built the package and ran R CMD check --as-cran locally (with suggested packages available).
  • Result: 0 ERRORs, 3 NOTEs. The NOTES are informational and include:
    • Some moved/404 URLs in 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.
    • HTML Tidy in the check environment is older (non-critical NOTE).
  • Confirmed there are no remaining usages of aes_string or aes_ in the source via code search.

How to test locally

  1. From the package root, build and check locally:
R CMD build .
R CMD check --as-cran enrichplot_*.tar.gz
  1. Quick runtime smoke test (interactive R):
# from package root
# (optionally) devtools::load_all('.')
# run a few plotting functions with small sample inputs

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

  • Update broken/moved URLs in NEWS.md and DESCRIPTION to remove 404s.
  • Consider normalizing the package version string to avoid leading-zero warnings prior to release.
  • Optionally restore certain examples from \donttest{} to runnable form when desired; they were wrapped to avoid long running examples on CRAN-style checks.
  • Add a small set of unit/integration tests (or automated smoke tests) covering the main plotting flows so future changes are validated automatically.
  • Consider adding CI (GitHub Actions) that runs R CMD check with the same configuration as Bioconductor/CRAN to catch regressions early.

Generated on: 2025-10-03 wiht GPT5

It replaces all uses of the deprecated aes_string() and aes_() helpers with tidy-eval friendly constructs (aes() + .data / .data[[...]])
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.

1 participant