title: Apply the same function with multiple columns as inputs to multiple columns in R with tidyverse
body: <p>As an example, I have the following data frame:</p>
  <pre><code>df &lt;- data.frame(a1=1,a2=2,a3=3,b1=1,b2=2,b3=3)
  </code></pre>
  <p>I have a function:</p>
  <pre><code>fn &lt;- function(x,y,z) x^y+(z-x)^(y-x)
  </code></pre>
  <p>I want the following:</p>
  <pre><code>df &lt;- df %&gt;% mutate(a=fn(a1,a2,a3),b=fn(b1,b2,b3))
  </code></pre>
  <p>The problem is, I have tons of triplets in my dataset, so it is not ideal to write them out one by one.</p>