-
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
geom_boxplot() with data rows >1 and stat = "identity" fails #3316
Comments
This is a problem with the group aesthetic. We infer grouping based on the categorical variables, and library(ggplot2)
# without group aesthetic
ggplot(
data.frame(x = "one value", y = 3, value = 4:6),
aes(x, ymin = 0, lower = 1, middle = y, upper = value, ymax = 10)
) +
geom_boxplot(stat = "identity")
#> Error: Elements must equal the number of rows or 1
# with group aesthetic
ggplot(
data.frame(x = "one value", y = 3, value = 4:6),
aes(x, group = 1:3, ymin = 0, lower = 1, middle = y, upper = value, ymax = 10)
) +
geom_boxplot(stat = "identity") Created on 2019-05-08 by the reprex package (v0.2.1) The solution is that the package authors need to supply a group aesthetic. I don't think there's anything to be done on our side. |
I will contact the developer...there are some other things about that particular plot that could be improved. On our end, Lines 211 to 220 in 92d2777
If the previous version of
I'd be happy to PR any of those if it's worth doing. |
A couple of comments, in no particular order:
|
I've contacted the developer of HistDAWass with a suggestion of to fix this problem in their package code. |
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/ |
In the revdep checks (#3303) at least one plot in an example failed to build that used
geom_boxplot(stat = "identity")
with more than one data row.In 3.1.1, this works as expected (position dodge would make more sense here, but I wanted to make sure this wasn't the issue).
The text was updated successfully, but these errors were encountered: