Closed
Description
Follow up after #2709, reusing the code from there; while #3416 which closed #2709 solved a part of the issue (release in 3.3.0), it still does not work in 3.3.3, but a different error is shown this time.
Someone else also encountered this behaviour 9 months ago and posted this question on SO.
library(ggplot2)
# Using stat_summary for aggregation
ggplot(mtcars, aes(x = factor(cyl), y = mpg, fill = factor(am))) +
stat_summary_bin(fun.y = sum, geom="bar", position = "stack")+
stat_summary(aes(label = stat(y)), fun.y = sum, geom = "text",
position = position_stack(vjust = .5))
#> Error: Discrete value supplied to continuous scale