coda_grep: Quickly subset an mcmc.list object using grep

Description Usage Arguments Value Author(s) See Also Examples

View source: R/coda_grep.R

Description

coda_grep takes as input an mcmc.list object and uses grep to find the parameters that match the specified pattern.

Usage

1
coda_grep(coda.object, pattern, return.matrix = FALSE, ...)

Arguments

coda.object

an mcmc.list object

pattern

character string giving the pattern to search for

return.matrix

should the mcmc.list object be returned as a single matrix. If TRUE, each element of the mcmc.list is binded together using rbind.

...

additional arguments for grep

Value

An mcmc, mcmc.list or matrix

Author(s)

Michael Malick

See Also

grep

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
library(coda)
data(line)

x <- coda_grep(line, "a")
head(x[[1]])

x <- coda_grep(line, "beta")
head(x[[1]])

x <- coda_grep(line, "sig")
head(x[[1]])

x <- coda_grep(line, "a", return.matrix = TRUE)
class(x)
dim(x)
head(x)

michaelmalick/r-codatools documentation built on May 22, 2019, 9:51 p.m.