Briefly, a warning is thrown when a scale was declared, but none of the data has the relevant aesthetic.
I had to touch the build method to coordinate this warning, but if extensions don't update they should skip the warning, so it should be safe.
Reprex from issue:
devtools::load_all("~/packages/ggplot2")
#> ℹ Loading ggplot2
ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) +
geom_boxplot() +
scale_colour_brewer(
name = 'Dude which plant',
palette = 'Set2'
)
#> Warning in scale_colour_brewer(name = "Dude which plant", palette = "Set2"):
#> Scale for colour aesthetic was provided but has no matching data to map.
This PR aims to fix #3743.
Briefly, a warning is thrown when a scale was declared, but none of the data has the relevant aesthetic.
I had to touch the build method to coordinate this warning, but if extensions don't update they should skip the warning, so it should be safe.
Reprex from issue:
Created on 2024-05-27 with reprex v2.1.0