add_block.Rd
Add a block to a stan model. If that block exists, it will be removed first.
add_block(x, name, lines)
a stanedit
object
name of the block
character vector, lines in the block
a stanedit
object containing the new block
model_file_name <- system.file(package = "stanedit", "regression.stan")
reg <- stanedit(filename = model_file_name)
reg <- add_block(
reg,
"transformed parameters",
c("real gamma;", "gamma = alpha * beta;")
)
#> Warning: Nothing to remove.