Skip to content
Prev 393526 / 398503 Next

Pipe operator

Maybe I missed it in the whole discussion, but since R 4.2.0 the base R 
pipe operator also has a placeholder '_' to specify where the result of 
the left-hand side should be used in the right-hand side (see 
https://stat.ethz.ch/pipermail/r-announce/2022/000683.html).

So the only difference in usage between >%> and |> is that the 
placeholder '.' of the magrittr pipe can appear several times.
It would also be nice if R/Rstudio had a default keyboard shortcut to 
insert the base R pipe like for the magrittr pipe (Ctrl+Shift+M or 
Cmd+Shift+M). The vertical bar is not always easy to find (especially 
when you switch between Mac, Windows and different languages).

Ivan
On 03/01/2023 19:34, avi.e.gross at gmail.com wrote: