Published on *OpenMx* (http://openmx.psyc.virginia.edu)

By *mspiegel*

Created *09/01/2009 - 16:40*

Tue, 09/01/2009 - 16:40 — mspiegel [1]

As of revision 784, literal constant substitution is implemented in the repository. This only works for literal expressions that evaluate to constants, such as "1" or "1.0" or "8675903". There is a trivial example in models/passing/ConstantSubstitution.R replicated here in its entirety:

require(OpenMx) foo <- mxAlgebra(1 + 2 + 3, 'foo') model <- mxModel('model', foo) modelOut <- mxRun(model) omxCheckEquals(6, mxEval(foo, modelOut))

The next step will be to implement free parameter and fixed parameter substitution (this week), and then I can finish with global variable substitution in algebra expressions (either this week or next week).

**Links:**

[1] http://openmx.psyc.virginia.edu/users/mspiegel

[2] http://openmx.psyc.virginia.edu/thread/151

[3] http://openmx.psyc.virginia.edu/thread/136

[4] http://openmx.psyc.virginia.edu/forums/openmx-developer-forums/r-functions-and-user-interface