You are here

General strategies

1 post / 0 new
mspiegel's picture
Offline
Joined: 07/31/2009 - 15:24
General strategies
  1. Use the traceback() function in R after an error occurs.
    It will print out the sequence of function calls that lead to the error.
  2. Simplify your code. This may help you locate an error more easily. For example, replace the following:
    foo <- mxModel(mxMatrix('Full', 1, 2, name = 'a'), 
        mxAlgebra(a + a, 'b'), mxAlgebraObjective('b'))

    with:

    aMatrix <- mxMatrix('Full', 1, 2, name = 'a')
    bAlgebra <- mxAlgebra(a + a, name = 'b')
    objective <- mxAlgebraObjective('b')
    model <- mxModel(aMatrix, bAlgebra, objective)