The function samplesSamplewill provide you with a complete MCMC to illustrate using the example in the help file BRugs...
library("BRugs")
exfiles <- dir(options()$OpenBUGSExamples, pattern="^Rats.*txt$", full.names=TRUE)
ok <- file.copy(exfiles, tempdir())
oldwd <- setwd(tempdir())
modelCheck("Ratsmodel.txt")
modelData("Ratsdata.txt")
modelCompile(numChains=2)
modelInits(rep("Ratsinits.txt", 2))
modelUpdate(1000)
samplesSet(c("alpha0", "alpha"))
modelUpdate(1000)
You can extract an MCMC sample, such as alphanode, and do whatever you like with it,
alpha0<-samplesSample("alpha0")
hist(alpha0)

source
share