I have looked everywhere and I still cannot find a function in R that can help me write a coda file from a mcmc object. I am running OpenBUGS in R using the R2OpenBUGS package:
output <- bugs(...)
Then after some manipulation, I am left with an object called chain_mat
that has class mcmc
. This object is rather long (over 2 million rows) so I want to create a coda file to save the draws. I am aware you can create coda files directly from the bugs
function but I need to do some manipulations first, before I can create the file.
Any ideas would be greatly appreciated.