title: dplyr group by colnames described as vector of strings
body: <p>I'm trying to group_by multiple columns in my data frame and I can't write out every single column name in the group_by function so I want to call the column names as a vector like so:</p>
  
  <pre><code>cols &lt;- colnames(mtcars)[grep("[a-z]{3,}$", colnames(mtcars))]
  mtcars %&gt;% filter(disp &lt; 160) %&gt;% group_by(cols) %&gt;% summarise(n = n())
  </code></pre>
  
  <p>This returns error:</p>
  
  <pre><code>Error in mutate_impl(.data, dots) : 
    Column `mtcars[colnames(mtcars)[grep("[a-z]{3,}$", colnames(mtcars))]]` must be length 12 (the number of rows) or one, not 7
  </code></pre>
  
  <p>I definitely want to use a dplyr function to do this, but can't figure this one out.</p>