Skip to content

placeholder for native pipes

6 messages · Ivan Krylov, Jeff Newmiller, Ivan Calandra

#
Dear useRs,

When the implementation of the native pipe was announced (e.g. 
https://www.r-bloggers.com/2021/05/the-new-r-pipe/), there was no 
placeholder similar to the dot in magrittr.

Has it changed? Is there now a placeholder? There is no mention of it in 
the help page for "|>" so I guess not, but maybe someone on the list 
knows more about future developments?

Thank you!
Ivan
#
On Wed, 9 Mar 2022 13:57:36 +0100
Ivan Calandra <ivan.calandra at rgzm.de> wrote:

            
In an interesting coincidence, support for use of _ as a placeholder
(once per call, in named arguments) in native R pipe has been committed
to R-devel yesterday:
https://github.com/r-devel/r-svn/commit/7cce339c9fc2f61b228d2ea2a022a0cf60d86155
#
Thank you Ivan for the info. That's exciting!
Do you also know for which R release it is planned?

Ivan

--
Dr. Ivan Calandra
Imaging lab
RGZM - MONREPOS Archaeological Research Centre
Schloss Monrepos
56567 Neuwied, Germany
+49 (0) 2631 9772-243
https://www.researchgate.net/profile/Ivan_Calandra
On 09/03/2022 14:14, Ivan Krylov wrote:
#
On Wed, 9 Mar 2022 14:16:47 +0100
Ivan Calandra <ivan.calandra at rgzm.de> wrote:

            
Assuming it survives in its present state, I think it'll be released
together with R 4.2.0. Definitely not R-patched (4.1.x) if my
understanding of <https://developer.r-project.org/devel-guidelines.txt>
is correct, but I'm not an R developer.
#
Not currently, but you can emulate it with the anonymous function shorthand:

(\(.) expression_using_dot ))()

e.g. https://i.reddit.com/r/rstats/comments/nkiavh/is_base_r_pipe_faster_than_dplyr/
On March 9, 2022 4:57:36 AM PST, Ivan Calandra <ivan.calandra at rgzm.de> wrote:

  
    
#
Dear Jeff,

Thank you for the hint. I had read about it. While it is quite useful, I 
doubt that any of my colleagues would understand the construct... 
Waiting for the placeholder :)

Best,
Ivan

--
Dr. Ivan Calandra
Imaging lab
RGZM - MONREPOS Archaeological Research Centre
Schloss Monrepos
56567 Neuwied, Germany
+49 (0) 2631 9772-243
https://www.researchgate.net/profile/Ivan_Calandra
On 09/03/2022 18:21, Jeff Newmiller wrote: