Using pipe operator instead of "+" (or additionally)
Closed this issue · 2 comments
This is less of a request but more of a question: Have you thought about using the '%>%' operator instead of the ggplot-like '+', or at least allow both?
While it makes sense to copy features from the original, Hadley himself mentioned that he would prefer if ggplot could handle the pipe, but cant for historical reasons.
Great question @SebaStad ! The use of the addition operator was very intentional - I wanted the package to mirror the syntax of ggplot2 since so many people are familiar with it. Using the pipe syntax instead may have been more straightforward in terms of implementation.
That said, including an option for both doesn't seem to introduce any major complications. I've put together a minimal example in this pipesyntax branch (see the second last section of the readme). I'll aim to keep the option of a pipe operator in combination with the "add_" prefix. I can't see this causing any problems down the track, but if it does I'll prioritise the original + syntax.
Thanks for the suggestion!