title: Summing across selected columns (using select() methods) in dplyr
body: <p>Summing across columns by listing their names is fairly simple:</p>
  
  <p><code>iris %&gt;% rowwise() %&gt;% mutate(sum = sum(Sepal.Length, Sepal.Width, Petal.Length))</code></p>
  
  <p>However, say there are a lot more columns, and you are interested in extracting all columns containing "Sepal" without manually listing them out. Specifically, I'm looking for a method in the same way select() in dplyr allows you to subset columns with with contains(), starts_with(), etc. </p>
  
  <p>There are ways to use mutate_all() + sum() + join() in order to fulfill the same result as this query, but I am more interested in seeing something as close to the solution as the code below:</p>
  
  <p><code>iris %&gt;% rowwise() %&gt;% mutate(sum = sum(contains(colnames(.), "Sepal")))</code></p>