Extract the variables declared in a stan model

get_vars(x, block)

Arguments

x

a stanedit object

block

character (optional), the block or blocks in which to search; by default the whole model will be searched

Value

a character vector of variable names

Examples

model_file_name <- system.file(package = "stanedit", "regression.stan")
reg <- stanedit(filename = model_file_name)
get_vars(reg, "parameters")
#> [1] "alpha" "beta"  "sigma"