title: How to construct a table from a t-test in R
body: <p>I was provided with three t-tests:</p>
  
  <pre><code>Two Sample t-test
  
  data:  cammol by gender
  t = -3.8406, df = 175, p-value = 0.0001714
  alternative hypothesis: true difference in means is not equal to 0
  95 percent confidence interval:
   -0.11460843 -0.03680225
  sample estimates:
  mean in group 1 mean in group 2 
         2.318132        2.393837 
  
  
  Welch Two Sample t-test
  
  data:  alkphos by gender
  t = -2.9613, df = 145.68, p-value = 0.003578
  alternative hypothesis: true difference in means is not equal to 0
  95 percent confidence interval:
   -22.351819  -4.458589
  sample estimates:
  mean in group 1 mean in group 2 
         85.81319        99.21839 
  
  
  Two Sample t-test
  
  data:  phosmol by gender
  t = -3.4522, df = 175, p-value = 0.0006971
  alternative hypothesis: true difference in means is not equal to 0
  95 percent confidence interval:
   -0.14029556 -0.03823242
  sample estimates:
  mean in group 1 mean in group 2 
         1.059341        1.148605
  </code></pre>
  
  <p>And I want to construct a table with these t-test results in R markdown like:
  <a href="https://i.stack.imgur.com/T5DvZ.png" rel="nofollow noreferrer">wanted_table_format</a></p>
  
  <p>I've tried reading some instructions for using "knitr" and "kable" functions, but honestly, I do not know how to apply the t-test results to those functions. </p>
  
  <p>What could I do?</p>