title: mutate_at - functions involving two variables
body: <p>If I have a data frame like</p>
  
  <pre><code>set.seed(1)    
  df &lt;- data.frame(X = 5:14,
         Y = runif(10,0,1),
         Z = runif(10,0,1))
  </code></pre>
  
  <p>I can do</p>
  
  <pre><code>df %&gt;% mutate(Y = if_else(X &gt; 10, -Y, Y),
                Z = if_else(X &gt; 10, -Z, Z))
  </code></pre>
  
  <p>But if I have a lot of variables to transform in the same way, I prefer to use mutate_at. However, I don't get it to work properly in this case.</p>
  
  <p>My attempt:</p>
  
  <pre><code>testfun &lt;- function(y){if_else(X &gt; 10, -y, y)}
  df %&gt;% mutate_at(vars(c("Y","Z")),funs(testfun))
  </code></pre>
  
  <p>But this results in <code>Evaluation error: object 'X' not found</code>. I tried variations like <code>get("X")</code>, but it didn't work. Does anyone knows a variations that does work?</p>