ggeasy icon indicating copy to clipboard operation
ggeasy copied to clipboard

Recognize color besides colour

Open bersbersbers opened this issue 5 years ago • 1 comments

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.

bersbersbers avatar Aug 21 '20 11:08 bersbersbers

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.

jonocarroll avatar Aug 22 '20 01:08 jonocarroll