Dot Pipe

John Mount

2017-08-24

The “dot pipe” is an operator with a very simple definition:

“a %.>% b” is to be treated as if the user had written “{ . <- a; b };” with “%.>%” being treated as left-associative. (there are “.” associated side-effects).

This is deliberately more regular than and has considerably fewer corner cases than the magrittr pipe used by dplyr.

For example, the following all evaluate to the same (which is not the case for magrittr::%>%):

library("wrapr")

1 %.>% c(c(.))
## [1] 1
1 %.>% { c(c(.)) }
## [1] 1

For more discussion please see here.