Skip to content
Prev 57566 / 63421 Next

should base R have a piping operator ?

On 05/10/2019 7:50 p.m., Gabriel Becker wrote:
Actually, that could be done in package space too:  just write a 
function to do the transformation.  That is, something like

    transformPipe( a %>% b %>% c )

could convert the original expression into one like yours below.  This 
could be done by a smart IDE like RStudio without the user typing anything.

A really strong argument for doing this in a package instead of Bison/C 
code in the parser is the help page ?magrittr::"%>%".  There are so many 
special cases there that it's certainly hard and possibly impossible for 
the parser to do the transformation:  I think some parts of the 
transformation depend on run-time values, not syntax.

Of course, a simpler operator like Antoine's would be easier, but that 
would break code that uses magrittr pipes, and I think those are the 
most commonly accepted ones.

So a workable plan would be for all the pipe authors to agree on syntax 
for transformPipe(), and then for IDE authors to support it.  R Core 
doesn't need to be involved at all unless they want to update Rgui or 
R.app or command line R.

Duncan Murdoch

Thread (33 messages)

Ant F should base R have a piping operator ? Oct 5 Jeff Ryan should base R have a piping operator ? Oct 5 John Mount should base R have a piping operator ? Oct 5 Hugh Marera should base R have a piping operator ? Oct 5 David Hugh-Jones should base R have a piping operator ? Oct 5 Ant F should base R have a piping operator ? Oct 5 John Mount should base R have a piping operator ? Oct 5 Rui Barradas should base R have a piping operator ? Oct 5 Iñaki Ucar should base R have a piping operator ? Oct 5 Iñaki Ucar should base R have a piping operator ? Oct 5 Ant F should base R have a piping operator ? Oct 5 Hugh Marera should base R have a piping operator ? Oct 5 Iñaki Ucar should base R have a piping operator ? Oct 5 Ant F should base R have a piping operator ? Oct 5 Gabriel Becker should base R have a piping operator ? Oct 5 Joris Meys should base R have a piping operator ? Oct 6 Iñaki Ucar should base R have a piping operator ? Oct 6 John Mount should base R have a piping operator ? Oct 6 Duncan Murdoch should base R have a piping operator ? Oct 6 Ant F should base R have a piping operator ? Oct 6 Lionel Henry should base R have a piping operator ? Oct 7 Duncan Murdoch should base R have a piping operator ? Oct 7 Lionel Henry should base R have a piping operator ? Oct 7 Duncan Murdoch should base R have a piping operator ? Oct 7 Lionel Henry should base R have a piping operator ? Oct 7 Luke Tierney should base R have a piping operator ? Oct 7 Lionel Henry should base R have a piping operator ? Oct 7 Luke Tierney should base R have a piping operator ? Oct 7 Kevin Ushey should base R have a piping operator ? Oct 7 Lionel Henry should base R have a piping operator ? Oct 7 Lionel Henry should base R have a piping operator ? Oct 7 Luke Tierney should base R have a piping operator ? Oct 7 Luke Tierney should base R have a piping operator ? Oct 7