-
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
Warning message with stat_function()
when using purrr::map2
#5498
Comments
More minimal reprex to reproduce warning: library(ggplot2)
#> Warning: package 'ggplot2' was built under R version 4.3.1
ggplot(mtcars, aes(disp, hp, fill = wt)) +
geom_point() +
stat_function(fun = ~ .x)
#> Warning: The following aesthetics were dropped during statistical transformation: fill
#> ℹ This can happen when ggplot fails to infer the correct grouping structure in
#> the data.
#> ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
#> variable into a factor? Created on 2023-10-26 with reprex v2.0.2 In any case, I think the warnings are appropriate, as you've specified |
I tend to agree that the warning is appropriate even if it is a bit confusing here. The code is asking |
Yeah agreed. Because it is working as intended, I'll close this as 'not a bug'. |
Thanks for the insight. Seems like I should put fill=wt inside of geom_point(). |
I found a problem with
stat_function()
, it produces some warning messages although the result is as expected.Here is the code to reproduce the bug:
Below is the warning message
The text was updated successfully, but these errors were encountered: