I know that if the placeholder is only used in a nested function call, the lhs is also placed as the first argument, and we can override this by wrapping the rhs in braces. However, I'm wondering if there's a straightforward way, using magrittr's exported functions, to create a new pipe operator that allows multiple placements but never places the lhs as the first argument.
In other words, would it be easy to define a new pipe, say %>>%, that makes these two commands equivalent?
1:10 %>% {c(min(.), max(.))}
1:10 %>>% c(min(.), max(.))
I'm not suggesting that this functionality should be included in magrittr, as I understand the current design choices are deliberate. I'm just asking if I wanted this functionality in my own code, would it be straightforward to implement using one of the exported functions from magrittr?
Hi!
I know that if the placeholder is only used in a nested function call, the lhs is also placed as the first argument, and we can override this by wrapping the rhs in braces. However, I'm wondering if there's a straightforward way, using magrittr's exported functions, to create a new pipe operator that allows multiple placements but never places the lhs as the first argument.
In other words, would it be easy to define a new pipe, say
%>>%
, that makes these two commands equivalent?I'm not suggesting that this functionality should be included in magrittr, as I understand the current design choices are deliberate. I'm just asking if I wanted this functionality in my own code, would it be straightforward to implement using one of the exported functions from magrittr?
Thanks!