model$intervals = NULL
doesn't error, but it does nothing (the interval requests remain)
model@intervals = NULL
fails with an error:
Error in checkAtAssignment("MxModel", "intervals", "NULL") :
assignment of an object of class “NULL” is not valid for @‘intervals’ in an object of class “MxModel”;
It would be nice if the $ operator allowed removing CI requests from models.
Currently (for reasonable reasons), adding a CI request doesn't step on the existing ones, so they just accumulate with no obvious way to remove potentially expensive but unwanted CI requests.
#1
model$intervals = NULL
Now gives an informative error.
Error: I'm very sorry, but direct modification of objects inside an mxModel is not supported. The recommended approach to modifying an mxMatrix, mxAlgebra or other object within a model is to rebuild the mxModel. So, for example, 'model <- mxModel(model, Something)' can be used to replace Something inside the model, instead of 'model$Something <- Something' which does not work
Log in or register to post comments
#2
model@intervals <- list()
.Log in or register to post comments
#3
Log in or register to post comments