title: Using R to find several fisher's exact test p value in sequence
body: <p>I have over <strong>5000</strong> data sets that i want to find p values for using fishers exact test in R. They are saved in a <strong>csv</strong> file and look something like this;</p>
  
  <pre><code>100 5000 400 500
  250 400  600 400
  
  
  ... ... ... ...
  </code></pre>
  
  <p>where each row represents a contingency table. 
  Right now, I'm having to do a contingency table at a time, which will take me forever. </p>
  
  <p>I used this code so far
      alltables&lt;-read.table("untitled1.csv") ##to read my data 
      apply(alltables,1, function(x) fisher.test(matrix(x,nr=2))$p.value)</p>
  
  <p>But then I get the error "Error in fisher.test(matrix(x, nr = 2)) : 'x' must have at least 2 rows and columns"     </p>