You are here

remove interval (CI requests) with model$intervals = NULL

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.

Reporter: 
Created: 
Mon, 07/28/2014 - 21:22
Updated: 
Thu, 09/29/2016 - 09:37

Comments

UPDATE: with OpenMx version: 2.5.2 [GIT v2.5.2]

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

Try model@intervals <- list().

duplicate