title: Fisher's exact test on rows in data frame - R
body: <p>I have a data frame of n rows that resembles below (with some extra columns containing additional information not listed):</p>
  
  <pre><code>           R1counti    R1counto     R2counti    R2counto    R1    R2
  sample1    100         100          1000        1000        1     1
  smaple2    50          100          50           50         0.5   1
  </code></pre>
  
  <p>For each row, I want to perform a fisher's exact test to determine if the R1 ratio is significantly different from the R2 ratios (and also in the end get an adjusted p-val)</p>
  
  <p>Desired output (with the count columns still included in the out):               </p>
  
  <pre><code>           R1    R2      pval
   sample1   1     1       1
   sample2   0.5   1       0.05
  </code></pre>
  
  <p>I thought I could do something like:</p>
  
  <pre><code>dataframe$p-val &lt;- with(dataframe, p-val &lt;- fisher.test(R1, R2, alternative= "two.sided"))
  </code></pre>
  
  <p>But I get an error:</p>
  
  <pre><code>FEXACT error 40.
  Out of workspace.
  </code></pre>
  
  <p>Maybe I'm not handling this situation correctly. Any advice? Suggestions? Can I perform a fishers test like this?</p>