omxCheckError {OpenMx} | R Documentation |
This function tests whether the correct error message is thrown.
omxCheckError(expression, message)
expression |
an R expression that produces an error |
message |
a character string with the desired error message |
Arguments ‘expression’ and ‘message’ give the expression that generates the error and the message that is supposed to be generated, respectively.
The OpenMx User's guide can be found at http://openmx.psyc.virginia.edu/documentation.
omxCheckWarning
omxCheckWithinPercentError
,
omxCheckIdentical
, omxCheckSetEquals
,
omxCheckTrue
, omxCheckEquals
A <- mxMatrix('Full', 1, 1, labels = 'data.foo', free = TRUE, name = 'A') model <- mxModel('model', A) omxCheckError(mxRun(model), paste("The definition variable 'data.foo'", "has been assigned to a", "free parameter in matrix 'A'")) omxCheckCloseEnough(matrix(3, 3, 3), matrix(4, 3, 3), epsilon = 2) # Throws error, check the message omxCheckError(omxCheckCloseEnough(c(1, 2, 3), c(1.1, 1.9 ,3.0), epsilon = 0.01), "In omxCheckCloseEnough(c(1, 2, 3), c(1.1, 1.9, 3), epsilon = 0.01) : not equal to within 0.01 : '1 2 3' and '1.1 1.9 3'")