You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
facet_grid with an expression cannot have margins #1864
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.
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 quoted_df()).
@hadley Let me know if this seems like the right direction.
@has2k1 You're right. But why does % git status give output that makes it look like I'm up to date? On branch master
Your branch is up-to-date with 'hadley/master'.
git status is only as accurate as the state created by last git fetch. git status on its own does not initiate a network connection and so it does not show "real time" information.
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).
Activity
DanRuderman commentedon Oct 21, 2016
The relevant code (in facet-grid-.r) seems to be:
The call to
quoted_df()handles the expression evaluation needed to add the values that are missing, but this comes after the call toadd_margins().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
quoted_df()).@hadley Let me know if this seems like the right direction.
Thanks
has2k1 commentedon Oct 23, 2016
@DanRuderman, you need to pull from master.
DanRuderman commentedon Oct 24, 2016
@has2k1 You're right. But why does
% git statusgive output that makes it look like I'm up to date?On branch master
Your branch is up-to-date with 'hadley/master'.
The relevant output from
% git remote -vis:hadley https://github.com/hadley/ggplot2.git (fetch)
hadley https://github.com/hadley/ggplot2.git (push)
has2k1 commentedon Oct 24, 2016
git statusis only as accurate as the state created by lastgit fetch.git statuson its own does not initiate a network connection and so it does not show "real time" information.paleolimbot commentedon Jul 7, 2019
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).
dmurdoch commentedon Apr 5, 2020
Would it be possible to detect this and issue a warning? Or at least document it in the help page?