title: dplyr mutate: pass list of variables to create multiple new variables
body: <p>I'm trying to do something that intuitively feels straightforward but I can't figure it out. I'm hoping to calculate delta's for a number of columns: I have columns <code>A1, B1, C1</code> and <code>A2, B2, C2</code> and would like to create columns <code>A_delta, B_delta, C_delta</code> by subtracting <code>A2 - A1</code> etc.</p>
  
  <p>Here's what I thought I could do with <code>dplyr</code> (using <code>mtcars</code> as example):</p>
  
  <pre><code># Create test data with changed columns
  d.test &lt;- mtcars %&gt;% 
              rownames_to_column() %&gt;% 
              mutate(mpg2 = mpg - 4, 
                     cyl2 = cyl - 1)
  
  # Calculate deltas &amp; add as new columns
  d.test %&gt;% mutate(!!c("mpg_delta", "cyl_delta") := c(mpg2, cyl2) - c(mpg, cyl))
  </code></pre>
  
  <p>Clearly it doesn't work like this, but I cannot for the life of me figure out the right syntax. I've been reading up on using <code>purrr</code> but that seems applicable when trying to do different actions per row (like here <a href="https://stackoverflow.com/questions/49311043/dplyr-mutate-using-variable-columns">dplyr mutate using variable columns</a>), not when trying to create multiple new columns...</p>
  
  <p>Any pointers would be great!</p>