Force arguments that are used in closures #2807
The reprex below triggered the investigation that led to possible instances where "brittle closures" are returned. I have no idea if the other instances I found have an effect, but it feels like good practice to force arguments that are used by closures.
Happy to add tests as necessary.
library(tidyverse) scale <- c("red", "green", "blue") p <- ggplot(iris, aes(Petal.Length, Petal.Width, color = Species)) + geom_point() + scale_color_manual(values = unlist(scale), labels = levels(iris$Species)) scale <- scale[-1] p
The text was updated successfully, but these errors were encountered: