title: How do I save all the draws from a MCMC posterior distribution to a file in R
body: <p>I'm running a Hierarchical Lin Regr model using <code>bayesm</code> package in R. I have a data set with one dependent and 6 predictors. There are 207 unique respondents with 35 observations for each.</p>
  
  <p>I began by using</p>
  
  <pre><code>print(out$betadraw)
  </code></pre>
  
  <p>Then I read about the <code>sink</code> function to output the <code>out$betadraw</code> to a file. I thought that <code>sink</code> function would capture all the draws. Instead the draws were truncated after certain number of draws.</p>
  
  <p>I need to capture all the draws. In addition, is it possible to pass objects from <code>bayesm</code> package to <code>coda</code> package for convergence diagnostics? Any help would be greatly appreciated.</p>