Learn R Programming

mcmcplots (version 0.2)

as.mcmc.bugs: Convert a bugs Object to an mcmc or mcmc.list Object

Description

This function converts a bugs object to an mcmc object so that the functions of the coda package may be used to analyze the posterior draws in the bugs object.

Usage

## S3 method for class 'bugs':
as.mcmc(x)

Arguments

x
bugs object

Value

  • If x contains multiple chains, the function returns an mcmc.list object. Otherwise, the function returns an mcmc object.

Details

None.

References

None.

See Also

bugs in R2WinBUGS

Examples

Run this code
## Data object "schools.sim" generated from the examples
## in the bugs function of the R2WinBUGS package.
outmcmc <- as.mcmc(schools.sim)

## Gelman Rubin diagnostics
coda:::gelman.diag(outmcmc)
coda:::mcmc.plot(outmcmc)

Run the code above in your browser using DataLab