title: Chain arithmetic operators in dplyr with %>% pipe
body: <p>I would like to understand why, in the the <code>dplyr</code> or <code>magrittr</code> package, and more specifically the chaining function <code>%&gt;%</code> has some trouble with the basic operators <code>+</code>, <code>-</code>, <code>*</code>, and <code>/</code></p>
  
  <p>Chaining takes the output of previous statement and feeds it as first argument of the next:</p>
  
  <pre><code>1:10 %&gt;% sum
  # [55]
  </code></pre>
  
  <p>Thus how come this doesn't work</p>
  
  <pre><code>1:10 %&gt;%  *2 %&gt;% sum
  1:10 %&gt;% .*2 %&gt;% sum
  </code></pre>
  
  <p>I also found that the following syntax works for adding/substracting, but not multiply or divide. why so?</p>
  
  <pre><code>1:10 %&gt;% +(2) # works OK
  1:10 %&gt;% *(2) # nope...
  </code></pre>
  
  <p>So should I write an anonymous function even to do a <code>*2</code> operation on my data.frame?</p>
  
  <pre><code>1:10 %&gt;% (function(x) x*2) %&gt;% sum
  </code></pre>
  
  <p>Thanks, I couldn't find the answer in other SO questions.</p>