Skip to content

use fortify.grouped_df() instead of ggplot.grouped_df() #2623

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

Merged

Conversation

yutannihilation
Copy link
Member

@yutannihilation yutannihilation commented May 17, 2018

fixes #2578

This PR removes ggplot.data.frame() and ggplot.grouped_df() so that all data passed to ggplot() get fortify()ed. Then, fortify.grouped_df() can take care of fortifying grouped_dfs.


Note that one possible downside of this PR is this change of behaviour of ggplot():

before after
data.frame not fortified fortified
others fortified fortified

fortify.data.frame() returns the original data.frame as is, but some objects inheriting from data.frame might be fortified if it has its own method of fortify().

But, I bet this will be rarely a problem; I cannot imagine the design where both the fortified version and unfortified version of the class are needed. If the method of fortify() is defined, it is probably supposed to be used.

@hadley hadley merged commit d7d18e8 into tidyverse:master May 17, 2018
@hadley
Copy link
Member

hadley commented May 17, 2018

Thanks!

@lock
Copy link

lock bot commented Nov 13, 2018

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Nov 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Simplify the usage of fortify() in ggplot()
2 participants