get_block.Rd
Returns the contents of a block in a stan model as a character vector of lines.
get_block(x, name, shell = FALSE)
a stanedit
object
name of the block
if TRUE (default:FALSE), will return the shell (i.e., the
definition of the block) as well as content; this is useful, e.g., to see
options passed to a transition
or ode
block
a character vector of the lines in the block, or an empty character vector if the block is not found
model_file_name <- system.file(package = "stanedit", "regression.stan")
reg <- stanedit(filename = model_file_name)
get_block(reg, "parameters")
#> [1] "real alpha;" "real beta;" "real<lower=0> sigma;"