This zip file contains R code and associated files for running BUGS from within R under Linux. The code makes use of some code modified from the BRugs package and Tarn Duong's rlinbugs.read function. All file names below refer to files in this zip archive.
The R code is in bugsAuxil.r. The example R code in runFromR.r in the example and simpleExample directories gives template code for using the functions in bugsAuxil.r to run BUGS from R. The core function in bugsAuxil.r is the bugsRun() function, which creates a BUGS script file with BUGS commands, runs the script in BUGS and reads the posterior sample output back into R in the form of a matrix. Note that you can fiddle with this function if you would like to add or remove BUGS commands from the script that is run. You can use the bugsData() and bugsInits() functions to create BUGS data and inits file from R. You can also use the bugsOutput() function on its own to read in output that has been generated using the BUGS samplesCoda function.
For long runs, you can monitor the output in the tmpLog file; this file is erased and its contents printed to the sc reen at the end of the run.
It's also possible to run BUGS by calling 'linbugs' from the command line in Linux. BUGS commands that can be used are given in the file bugsCommands.txt. However, note that not all of these seem to actually work. A core set of commands that definitely work can be seen in the script.txt files in the example and simpleExample directories.
Keywords: BUGS, OpenBUGS, WinBUGS
Last modified 12/5/08.