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
Failure to check aesthetics for geoms that use setup_data can cause cryptic error messages:
ggplot(iris) + geom_col()
## Error in pmin(y, 0) : object 'y' not found
## In addition: Warning messages:
## 1: In min(x, na.rm = na.rm) :
## no non-missing arguments to min; returning Inf
## 2: In max(x, na.rm = na.rm) :
## no non-missing arguments to max; returning -Inf
## 3: In min(diff(sort(x))) : no non-missing arguments to min; returning Inf
Compare to:
ggplot(iris) + geom_point()
## Error: geom_point requires the following missing aesthetics: x, y
This is because in Layer$compute_geom_1 we setup_data before we check_required_aesthetics.
I can definitely see the rationale for this if it is the case that some required aesthetics are generated by setup_data, which I guess is possible but seems a bit odd. After all, why would we require an aesthetic that would be auto generated?
The change is in theory trivial, but I can imagine it is possible there would be unintended consequences. I can make the change, test to see if anything breaks, and so on, but probably not in the next couple of weeks. If you're interested let me know and I'll work on a PR for the next release.
The text was updated successfully, but these errors were encountered:
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/
lockbot
locked and limited conversation to collaborators
Feb 3, 2019
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Failure to check aesthetics for geoms that use
setup_data
can cause cryptic error messages:Compare to:
This is because in
Layer$compute_geom_1
wesetup_data
before wecheck_required_aesthetics
.I can definitely see the rationale for this if it is the case that some required aesthetics are generated by
setup_data
, which I guess is possible but seems a bit odd. After all, why would we require an aesthetic that would be auto generated?The change is in theory trivial, but I can imagine it is possible there would be unintended consequences. I can make the change, test to see if anything breaks, and so on, but probably not in the next couple of weeks. If you're interested let me know and I'll work on a PR for the next release.
The text was updated successfully, but these errors were encountered: