jonocarroll / ggeasy

ggplot2 shortcuts (transformations made easy)
https://jonocarroll.github.io/ggeasy/
274 stars 20 forks source link

Recognize color besides colour #56

Open bersbersbers opened 4 years ago

bersbersbers commented 4 years ago
library(ggplot2)
df = data.frame(my_x=1, my_y=2, my_col=3)
p <- ggplot(df, aes(x=my_x, y=my_y, color=my_col)) + geom_point()
print(p + labs(colour = "works, too"))
print(p + labs(color = "works"))
print(p + ggeasy::easy_labs(colour = "works, yeah"))
print(p + ggeasy::easy_labs(color = "does not work"))

Ergo, ggeasy::easy_labs does not recognize color, while ggplot2::labs does.

jonocarroll commented 4 years ago

Good idea! ggplot2 does an internal lookup of aes alternatives and we can borrow that logic to be consistent.

I can't guarantee a timeline, so if you're interested you're welcome to have a go at implementing this change in a PR.