parse_equation.Rd
Create and parse a model equation
parse_equation(equation, envir)
equation | A text defining the equation. |
---|---|
envir | A named list with the indexes for the array. |
An expression with the code to evaluate the equation.
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 #> })