remove = TRUE issue
Posted on

Forums
try the following code
VA <- mxMatrix(name="VA", type="Symm", nrow=5, ncol=5)
DZ <- mxAlgebra(.5 %x% VA, name="covDZA")
test <- mxModel(model="test", VA, DZ )
test
names(test)
rm1 <- mxModel(test, test@matrices$VA, remove=TRUE)
rm2 <- mxModel(test, test@algebras$covDZA, remove=TRUE)
rm3 <- mxModel(test, test@algebras$DZ, remove=TRUE)
why doesn't remove=TRUE work with rm1 and rm2 while it fails to throw an error or warning with rm3?
thought that this was sorted out. see http://openmx.psyc.virginia.edu/thread/269
This looks like one big bug
Log in or register to post comments
In reply to This looks like one big bug by mspiegel
In the meantime, you can
rm1 <- test
rm1$VA <- NULL
But I'll fix it shortly.
Log in or register to post comments
OK I've checked in a patch to
At some point, a bug was introduced and remove = TRUE stopped working for character vectors. And since we never checked for the objects themselves when remove = TRUE, the thing was hopelessly broken. In the patch, some sensible error messages are printed when someone uses objects with remove = TRUE, or when someone uses character vectors when remove = FALSE. I've also added some test cases to the test suite to make sure this doesn't happen again.
So in OpenMx 1.0.4, the following will work:
Log in or register to post comments