title: dplyr summarise multiple columns using t.test
body: <p>Is it possible somehow to do a t.test over multiple variables against the same categorical variable without going through a reshaping of the dataset as follows?</p>
  
  <pre><code>data(mtcars)
  library(dplyr)
  library(tidyr)
  j &lt;- mtcars %&gt;% gather(var, val, disp:qsec)
  t &lt;- j %&gt;% group_by(var) %&gt;% do(te = t.test(val ~ vs, data = .))
  
  t %&gt;% summarise(p = te$p.value)
  </code></pre>
  
  <p>I´ve tried using</p>
  
  <blockquote>
    <p>mtcars %>% summarise_each_(funs = (t.test(. ~ vs))$p.value, vars = disp:qsec)</p>
  </blockquote>
  
  <p>but it throws an error.</p>
  
  <p>Bonus: How can <code>t %&gt;% summarise(p = te$p.value)</code> also include the name of the grouping variable?</p>