title: dplyr use select() helpers inside mutate()
body: <p>I'd to make a new variable which represents the sum (or other function) of many other variables which all start with "prefix_". Is there a way to do this neatly using these select() helpers (e.g. starts_with())?</p>
  
  <p>I don't <em>think</em> mutate_at() works for this since I'm just trying to create a single new variable based on many existing variables.</p>
  
  <p>My attempt:</p>
  
  <pre><code>df %&lt;&gt;%
    mutate(newvar = sum(vars(starts_with("prefix_"))))
  </code></pre>
  
  <p>This of course doesn't work. Many thanks!</p>
  
  <p>A reproducible example:</p>
  
  <pre><code>mtcars %&lt;&gt;% 
    rename("prefix_mpg" = mpg) %&gt;% 
    rename("prefix_cyl" = cyl) %&gt;% 
    mutate(newvar = sum(var(starts_with("prefix_"))))
  </code></pre>
  
  <p>Intended output would be mtcars$newvar which is the sum of prefix_mpg and prefix_cyl. Of course I could just explicitly name mpg and cyl but in my actual case it's a long list of variables, too long to name conveniently.</p>