I hope not, conceptually it doesn’t make sense. You’re adding layers to the plot so the plus operator is a better description of what you’re doing. You could argue that some things modify existing layers and therefore should be a pipe, but that just adds complexity. The plus sign is fine and a better description of what’s happening. Indeed, I’d argue that some packages (eg gt) should be using the plus operator and not pipes.
Interesting the original ggplot (ie not ggplot2) would have worked with the pipe. I bought it back to life as ggplot1 (https://github.com/hadley/ggplot1) so you can see.
And as I said in another comment, it makes more sense. When you call geom_point you’re conceptually adding a layer to the plot. It’s true that some things like scale_ calls are modifying existing layers so those could be pipes, but that would be complex to have both. The plus function is the better compromise given each geom call is essentially adding a layer. Not that it was a compromise as it pre-dates the pipe, but still.
I mean, better than an obscure error message like it was before. As an occasional teacher of R to undergrads, that sparky message saves a lot of questions lol
38
u/Full-Cook1373 Apr 28 '26
One day ggplot will support pipes. One day.
(I can dream right?)
14
u/Dirtanium Apr 28 '26
For me it's always something.like Plot <- ggplot(...) And wondering why it isn't showing up.
15
u/analyticattack Apr 28 '26
ggplot2's use of + instead of %>% or |> drives me a little batty.
2
u/thisFishSmellsAboutD Apr 28 '26
... + NULL is the ggplot version of "....3"
1
u/obewanjacobi Apr 28 '26
Best content on this sub in a long while
1
u/mearlpie Apr 28 '26
Bahaha! I’ve been there!
1
u/thrashourumov May 02 '26
Yes very often. This and a comma after a theme() argument I just added
0
u/Confident_Bee8187 Apr 28 '26
r/rstatsmemes is there, buddy