get_declaration.Rd
Returns the contents of a block in a stan model as a character vector of lines.
get_declaration(x, name)
a stanedit
object
name of the variable
a character vector of length 1 with the line where the variable is declared, or an empty character vector if no declaration is found
model_file_name <- system.file(package = "stanedit", "regression.stan")
reg <- stanedit(filename = model_file_name)
get_declaration(reg, "alpha")
#> [1] "real alpha;"