Skip to content

make sure aes renaming is reflected in data - #3733

Merged
thomasp85 merged 4 commits into
v3.3.0-rcfrom
color-sub
Jan 17, 2020
Merged

thomasp85 merged 4 commits into
v3.3.0-rcfrom
color-sub

Conversation

@thomasp85

Copy link
Copy Markdown
Member

This issue is based on failing revdep check of ggspectra and its reverse dependencies

Currently aes name standardisation changes every occurrence of "color" to "colour", not just the exact string "color". This has not been a problem before, but with the new aesthetic evaluation we have chosen to substituted names inside the expressions used in after_stat() and after_scale() and this causes problems if the expression references a US spelling column in the data.

This PR fixes it by only matching exactly to "color", but I'm unsure about whether there will be unforeseen consequences of this change. Another approach would be to substitute the names of the columns as well

@thomasp85 thomasp85 added this to the ggplot2 3.3.0 milestone Jan 15, 2020
@thomasp85
thomasp85 requested a review from clauswilke January 15, 2020 08:22
Comment thread R/aes.r Resolved
@thomasp85

Copy link
Copy Markdown
Member Author

I've pivoted on this and changed the fix to instead rename the data columns... I'm not 100% sure that this will not have consequences for extensions, but we'll have to wait for a new revdep check

@thomasp85 thomasp85 changed the title only convert exact color to UK spelling make sure aes renaming is reflected in data Jan 15, 2020
@clauswilke

Copy link
Copy Markdown
Member

I think this is the right approach. The rule "ggplot2 always considers US and UK spelling of colour to be the same thing, in all contexts" is clear and simple to remember. If there truly is an extension package that uses a column color and a column colour and expects them to be treated differently, I think it's reasonable to ask them to reconsider their column naming approach.

@clauswilke clauswilke left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I approve the PR, but I think it's critical to add a comment that explains what is being done and why.

@thomasp85
thomasp85 merged commit e214e44 into v3.3.0-rc Jan 17, 2020
@thomasp85
thomasp85 deleted the color-sub branch October 6, 2025 11:58
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.

3 participants