Retrieving the monte carlo simulation values for chi square test
<p>I am trying to graph the null distribution in a chi square test.In R it is feasible to do monte carlo simulation to get the empirical p value using the code:</p>

<pre><code>chisq.test(d,simulate.p.value=TRUE,B=10000)
</code></pre>

<p>But it does not return the distribution graph. Is there any way to make R to return the simulated values for the test?</p>