how to avoid R fisher.test workspace errors
<p>I am preforming a fisher's exact test on a large number of contingency tables and saving the p-val for a bioinformatics problem. Some of these contingency tables are large so I've increased the workspace as much as I can; but when I run the following code I get an error:</p>

<pre><code>result &lt;- fisher.test(data,workspace=2e9)
LDSTP is too small for this problem. Try increasing the size of the workspace.
</code></pre>

<p>if I increase the size of the workspace I get another error:</p>

<pre><code>result &lt;- fisher.test(data,workspace=2e10)
cannot allocate memory block of size 134217728Tb
</code></pre>

<p>Now I could just simulate pvals:</p>

<pre><code>result &lt;- fisher.test(data, simulate.p.value = TRUE, B = 1e5)
</code></pre>

<p>but Im afraid Ill need a huge number of simulations to get accurate results since my pvals may be extremely small in some cases.</p>

<p>Thus my question whether there is some way to preemptively check if a contingency table is too complex to calculate exactly? In those cases alone I could switch to using a large number of simulations with B=1e10 or something. Or at least just skip those tables with a value of "NA" so that my job actually finishes?</p>