backpipes: backpipes: %<%, %<<%

Description Usage Arguments Details References See Also Examples

Description

Provides back-piping operators %<% (magrittr) or %<<% (pipeR) allowing a reverses (right-to-left) order of arguments

Usage

1
2
3
lhs %<% rhs

lhs %<<% rhs

Arguments

lhs

argument on the lhs of the backpipe

rhs

argument on the rhs of the backpipe

Details

References

https://github.com/smbache/magrittr/issues/26
http://stackoverflow.com/questions/31305342/is-right-to-left-operator-associativity-in-r-possible

See Also

%>%
%>>%

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
  ## Not run: 
    require(magrittr)
    letters %>% paste0( 1:26 )  # forward pipe
    paste0( 1:26 ) %<% letters  # backward pipe

    mean %<% range( na.rm = TRUE ) %<% c(1:5, NA)
  
## End(Not run)
  
  ## Not run: 
    require(pipeR)
    letters %>>% paste0( 1:26 )  # forward pipe
    paste0( 1:26 ) %<<% letters  # backward pipe

    mean %<<% range( na.rm = TRUE ) %<<% c(1:5, NA)
  
## End(Not run)
  
  ## Not run: 
    require(shiny)
    div( class="outer-outer") %<%
      div( class="outer")     %<% 
        div( class="inner")   %<% 
          h1( "content", role="heading" )
   
## End(Not run)          

backpipe documentation built on May 2, 2019, 5:41 a.m.