-
Notifications
You must be signed in to change notification settings - Fork 2k
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
facet_grid with an expression cannot have margins #1864
Comments
The relevant code (in facet-grid-.r) seems to be:
The call to The possible solution I found is to replace those lines with:
Since I don't have much facility with conversion from calls to expressions to quoted symbols, I'm sure there is a prettier way. But the idea is to first add in to the data frame data columns representing the faceting variables when they are expressions (thus the first call to @hadley Let me know if this seems like the right direction. Thanks |
@DanRuderman, you need to pull from master. |
@has2k1 You're right. But why does The relevant output from |
|
After playing with this for a while, I'm not sure this can be done without completely rewriting how facets map data. For a few reasons, this may be a good thing (#2689 comes to mind). |
Would it be possible to detect this and issue a warning? Or at least document it in the help page? |
A visual of the issue,
The column (expression variable) margin is missing data!
The problem arises because these two lines depend on each other. The margins must be added with all the facet variables present in the data, yet the facet values must be computed with margins already computed and present in the data.
The text was updated successfully, but these errors were encountered: