title: How to define the pipe operator?
body: <p>I like the pipe (in <a href="/questions/tagged/dplyr" class="post-tag" title="show questions tagged &#39;dplyr&#39;" rel="tag">dplyr</a> or <a href="/questions/tagged/magrittr" class="post-tag" title="show questions tagged &#39;magrittr&#39;" rel="tag">magrittr</a> as mentioned in the comments) a lot but sometimes I run into errors which show me that I lack some understanding. In case of other functions or operators I mostly have at least some idea how they may be defined, but in case of the pipe I do not have even a clue where to start if I want to define it.</p>
  
  <p>I am really curious how the pipe is defined. So far I simply tried to assign it to an own operator but even this does not work. See here:</p>
  
  <pre><code>library(dplyr)
  
  `%pipe%` &lt;- `%&gt;%`
  
  data.frame() %pipe% class(.)
  # gives an error: subscript out of bounds
  </code></pre>
  
  <p>What magical ingredients make a pipe work? How could we define it ourselves? Thanks.</p>