title: Plot p-values for each boxplots measurements in groups
body: <p>I obtain the boxplot using this dataframe</p>
  
  <pre><code>library(reshape2)
  library(ggplot2)
  ID &lt;- c("DJ45","DJ46","DJ47","DJ48","DJ49","DJ53","DJ54","DJ55","DJ56","DJ57")
  Tool &lt;- c("Tool_A", "Tool_A", "Tool_A", "Tool_A", "Tool_A", "Tool_B", "Tool_B", "Tool_B", "Tool_B", "Tool_B")
  Name &lt;- c("CMP", "CMP", "CMP", "CMP", "CMP", "CMP", "CMP", "CMP", "CMP", "CMP")
  MS1 &lt;- c(51,55,50,59,50,47,48,42,43,46)
  MS2 &lt;- c(13,11,14,11,10,17,18,17,20,21)
  MS3 &lt;- c(2,3,2,5,6,4,9,6,4,4)
  MS4 &lt;- c(16,13,14,11,16,16,18,16,19,15)
  MS5 &lt;- c(3,6,3,6,3,4,4,8,5,4)
  MS6 &lt;- c(7,7,5,5,8,9,8,6,6,9)
  
  df1 &lt;- data.frame(ID,Tool,Name,MS1,MS2,MS3,MS4,MS5,MS6)
  df2&lt;-melt(df1,id.var=c("ID","Tool","Name"))
  
  p2 &lt;- ggplot(df2, aes(x=factor(Tool),y=value,fill=factor(Tool)))+
        geom_boxplot() + labs(title="CMP") +facet_wrap(~variable)
  p2
  </code></pre>
  
  <p>we get this plot, </p>
  
  <p><a href="https://i.stack.imgur.com/9MMZt.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9MMZt.jpg" alt="enter image description here"></a></p>
  
  <p>I then compare the different tools using t-test and obtain the p values for each measurements like this.</p>
  
  <pre><code>t.test(MS1 ~ Tool, df1)
  t.test(MS2 ~ Tool, df1)
  </code></pre>
  
  <p>I would like to include the p-value for each group in the plots. I referred to <a href="https://stackoverflow.com/questions/18335209/how-to-plot-additional-statistics-in-boxplot-for-each-group">this link</a> but confused how to code it to my problem. Kindly provide inputs/direction on how to solve this problem. </p>