Learn R Programming

mcmcplots (version 0.2)

caterpoints: Points on a "caterplot"

Description

Adds points to a caterplot.

Usage

caterpoints(x, parnames, horizontal = TRUE, ...)

Arguments

x
vector of points to add to a caterplot.
parnames
an optional vector of parameter names. If specified, x must have a names attribute. The argument parnames will be used to subset the vector x for plotting, as in x[parnames].
horizontal
logical value that should match the argument of the same name in the original call to caterplot.
...
further arguments passed to the function points.

Value

  • None.

Details

None.

References

None.

See Also

caterplot

Examples

Run this code
## Create fake MCMC output
nc <- 10; nr <- 1000
pnames <- c(paste("alpha[", 1:5, "]", sep=""), paste("gamma[", 1:5, "]", sep=""))
means <- rpois(10, 20)
fakemcmc <- as.mcmc.list(lapply(1:3, function(i) mcmc(matrix(rnorm(nc*nr, rep(means, each=nr)), nrow=nr, dimnames=list(NULL,pnames)))))

## caterplot plots of the fake MCMC output
par(mfrow=c(2,2))
caterplot(fakemcmc, "alpha", collapse=FALSE)
caterpoints(runif(5, -0.1, 0.1), pch="x", col="red")
caterplot(fakemcmc, "alpha", horizontal=FALSE)
caterpoints(runif(5, -0.1, 0.1), horizontal=FALSE, pch="x", col="red")

Run the code above in your browser using DataLab