Skip to contents

collect_var_to_name(vars) returns a named list from variable names to variables, as collect_var_to_name!. Elements of array variables are named by their array. Two different variables with the same name are an error.

Usage

collect_var_to_name(vars, out = list())

Arguments

vars

A list of variables.

out

An existing map to add to.

Value

A named list.

Examples

t <- t_nounits
collect_var_to_name(list(Variable("x", t), Parameter("k")))
#> $x
#> x(t)
#> 
#> $k
#> k
#>