title: How to perform statistical test using dplyr grouping and then make tibble with broom
body: <p>I have the following data frame:</p>
  
  
  
  <pre class="lang-r prettyprint-override"><code>library(tidyverse)
  
  dat &lt;- structure(list(charge.Group3 = c(0.167, 0.167, 0.1, 0.067, 0.033, 
  0.033, 0.067, 0.133, 0.2, 0.067, 0.133, 0.114, 0.167, 0.033, 
  0.1, 0.033, 0.133, 0.267, 0.133, 0.233, 0.1, 0.167, 0.067, 0.133, 
  0.1, 0.133, 0.1, 0.133, 0.1, 0.067, 0.167, 0), hydrophobicity.Group3 = c(0.267, 
  0.467, 0.067, 0.167, 0.267, 0.1, 0.367, 0.233, 0.367, 0.233, 
  0.133, 0.205, 0.333, 0.267, 0.267, 0.067, 0.133, 0.3, 0.233, 
  0.267, 0.5, 0.333, 0.2, 0.5, 0.5, 0.4, 0.033, 0.3, 0.233, 0.5, 
  0.233, 0.033), class = c("Negative", "Negative", "Positive", 
  "Positive", "Positive", "Positive", "Positive", "Negative", "Positive", 
  "Positive", "Positive", "Positive", "Positive", "Positive", "Negative", 
  "Positive", "Negative", "Negative", "Negative", "Negative", "Negative", 
  "Negative", "Negative", "Negative", "Negative", "Negative", "Positive", 
  "Positive", "Positive", "Negative", "Positive", "Negative")), class = c("tbl_df", 
  "tbl", "data.frame"), row.names = c(NA, -32L))
  
  dat
  #&gt; # A tibble: 32 x 3
  #&gt;    charge.Group3 hydrophobicity.Group3 class   
  #&gt;            &lt;dbl&gt;                 &lt;dbl&gt; &lt;chr&gt;   
  #&gt;  1         0.167                 0.267 Negative
  #&gt;  2         0.167                 0.467 Negative
  #&gt;  3         0.1                   0.067 Positive
  #&gt;  4         0.067                 0.167 Positive
  #&gt;  5         0.033                 0.267 Positive
  #&gt;  6         0.033                 0.1   Positive
  #&gt;  7         0.067                 0.367 Positive
  #&gt;  8         0.133                 0.233 Negative
  #&gt;  9         0.2                   0.367 Positive
  #&gt; 10         0.067                 0.233 Positive
  #&gt; # ... with 22 more rows
  </code></pre>
  
  <p>What I want to do for each features: <code>charge.Group3</code> and <code>hydrophobicity.Group3</code>, perform <code>wilcox.test</code> between Negative and positive class. And finally get the p-value as data frame or tibble:</p>
  
  <pre class="lang-r prettyprint-override"><code>features                      pvalue
  charge.Group3                 0.1088  
  hydrophobicity.Group3         0.03895
  # I do by hand.
  </code></pre>
  
  <p>Note that there are actually more than 2 features.
  How can I achieve that?</p>