data(mcmcListExample)
str(mcmcListExample)
# convert to class mcmcOutput
( mco <- mcmcOutput(mcmcListExample) )
summary(mco)
# Extract with "$"
p <- mco$p
str(p)
p[1:5,,] # Elements of p not defined in the model are filled with NAs
# "[" with one index, produces new mcmcOutput object
head(mco[4:5])
print(mco[c("z[35]", "z[39]")])
# "[" with two indices
mco[1:5, "psi"] # First 5 values for psi (chain #1)
# "[" with three indices
mco[1:5, 2, "psi"] # First 5 values for psi in chain #2
Run the code above in your browser using DataLab