title: R: How to create result table of the results of multiple statistics tests?
body: <p>I am a complete beginner in R.</p>
  
  <p>I ran multiple Chi-square tests on a column of data in R with this code: </p>
  
  <pre><code>apply(mydata, 2, chisq.test, p=expected.probability)
  </code></pre>
  
  <p>and got multiple results like this:</p>
  
  <blockquote>
    <p>$<code>Primary Tumor</code></p>
    
    <p>Chi-squared test for given probabilities</p>
    
    <p>data:  newX[, i] X-squared = 515108, df = 6, p-value &lt; 2.2e-16</p>
    
    <p>$<code>Primary Tumor_1</code></p>
    
    <p>Chi-squared test for given probabilities</p>
    
    <p>data:  newX[, i] X-squared = 583205, df = 6, p-value &lt; 2.2e-16</p>
    
    <p>$<code>Primary Tumor_2</code></p>
    
    <p>Chi-squared test for given probabilities</p>
    
    <p>data:  newX[, i] X-squared = 58089, df = 6, p-value &lt; 2.2e-16</p>
  </blockquote>
  
  <p>Can extract a results table with Tumour number, x-squared results, df and p-value of 50 samples I tested? </p>
  
  <p>I can copy and paste in excel but I wanna learn code for larger sample. </p>
  
  <p>Thank you:)</p>