Fix ggplot2 deprecation warnings (aes_string, size for lines)#53
Merged
arcaldwell49 merged 3 commits intomasterfrom Oct 3, 2025
Merged
Conversation
…and size with linewidth Co-authored-by: arcaldwell49 <24322628+arcaldwell49@users.noreply.github.com>
…imize_balance_alpha Co-authored-by: arcaldwell49 <24322628+arcaldwell49@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] ANOVA_design() triggers ggplot2 deprecation warnings (aes_string, size for lines)
Fix ggplot2 deprecation warnings (aes_string, size for lines)
Oct 2, 2025
There was a problem hiding this comment.
Pull Request Overview
This PR fixes ggplot2 deprecation warnings by updating deprecated API usage in the Superpower package. The changes address two main deprecation issues: replacing aes_string() with tidy evaluation using aes() and .data[[]], and replacing the deprecated size parameter with linewidth for line geometries.
- Replaced
aes_string()withaes()using.data[[]]pronoun for tidy evaluation - Updated
geom_line()andgeom_errorbar()to uselinewidthinstead of deprecatedsizeparameter
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| R/ANOVA_design.R | Updated aes_string() calls and geom_errorbar() size parameter |
| R/ANOVA_exact.R | Replaced aes_string() with tidy evaluation syntax |
| R/plot_power.R | Changed geom_line() size parameter to linewidth |
| R/minimize_balance_alpha.R | Updated geom_line() size parameter to linewidth |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
Calling
Superpower::ANOVA_design()and other plotting functions produced ggplot2 lifecycle warnings about deprecated APIs:aes_string()(deprecated since ggplot2 3.0.0)sizeaesthetic for lines (deprecated since ggplot2 3.4.0; replaced bylinewidth)Example warning:
Solution
1. Replaced
aes_string()withaes()using tidy evaluationBefore:
After:
The
.data[[]]pronoun is the recommended approach for programmatic column selection with ggplot2's tidy evaluation system.2. Replaced
sizewithlinewidthfor line geometriesBefore:
After:
Files Modified
R/ANOVA_design.R- Fixedaes_string()andgeom_errorbar()sizeR/ANOVA_exact.R- Fixedaes_string()R/plot_power.R- Fixedgeom_line()sizeR/minimize_balance_alpha.R- Fixedgeom_line()sizeImpact
Fixes #[issue_number]
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.