# load example mcmc.list
data(cjs)
# these produce same output b/c of regex pattern matching
match_params(cjs, params = c("b0", "b1"))
match_params(cjs, params = c("b"))
# return only base names, not indices as well
match_params(cjs, params = "b", type = "base_only")
# force a match to start with B
match_params(cjs, "^B")
# force a match to end with 0
match_params(cjs, "0$")
# use a wild card to get b0[3] and b1[3]
match_params(cjs, "b.[3]")
# repeat a wild card
match_params(cjs, "s.+0")
# turn off auto escape to use [] in regex syntax rather than matching them as text
match_params(cjs, params = "[:digit:]$", auto_escape = FALSE)
# pass a dot to match all (same as get_params)
match_params(cjs, ".")
Run the code above in your browser using DataLab