Create and parse a model equation

parse_equation(equation, envir)

Arguments

equation

A text defining the equation.

envir

A named list with the indexes for the array.

Value

An expression with the code to evaluate the equation.

Examples

equation <- list( equation = "y[c] = x[c]^2", indexes = "c in C" ) C <- c("sec1", "sec2", "sec3") parse_equation(equation, envir = globalenv())
#> expression(for (c in C) { #> y[c] = x[c]^2 #> })