title: How to create dataframe using results (output) of pairwise.t.test
body: <p>My df:</p>
  
  <pre><code>df &lt;- data.frame(
      measurement = runif(120, min=1, max=25),    
      group = rep(c("A","B","C","D"), each=3, times=10)
  )
  </code></pre>
  
  <p>performing t.test and putting results on new df</p>
  
  <pre><code>ttest_results &lt;- data.frame(pairwise.t.test(df$measurement, df$group))
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>Error in as.data.frame.default(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors) : 
    cannot coerce class ""pairwise.htest"" to a data.frame
  </code></pre>
  
  <p>I found this solution that works, but i honestly want to solve this through R</p>
  
  <pre><code>write.table(test[["p.value"]], file="output.csv", sep=",") 
  </code></pre>