title: summing multiple columns in an R data-frame quickly
body: <p>I have a data frame like <code>mtcars</code>, and a string vector of column names such as <code>c("mpg", "cyl", "disp", "hp", "drat")</code> , and I would like to sum together all of the columns into a new one.</p>
  
  <p>i would normally use something like </p>
  
  <pre><code>mtcars %&gt;% transmute(new_col = mpg + cyl + disp + hp + drat)
  
     new_col
  1   300.90
  2   300.90
  3   231.65
  4   398.48
  5   564.85
  6   356.86
  7   630.51
  </code></pre>
  
  <p>However, this becomes very tedious when you have 100s of column names, stored in a vector.</p>
  
  <p>So my question is, is there a way of summing together lots of columns, where the column names are held in a vector of strings?</p>