This works
Chol = mxMatrix(type="Full", 2,2, free=c(TRUE,TRUE,FALSE,TRUE), values=c(1,.2,0,1))
But this fails
Chol@free=c(TRUE,FALSE,FALSE,TRUE) Chol@values=c(1,0,0,1)
It would be nice, given that we can create the free and values slots with vectors, if we could also update them iwth vectors, using the pre-existing nrow and ncol of the MxMatrix to do this:
vec2MatFormxMatrix <- function(oldMat, newVec) { newMat = matrix(data=newVec, nrow=nrow(oldMat), ncol=ncol(oldMat) ) return(newMat) } newVec =c(TRUE,FALSE,FALSE,TRUE) if(is.vector(newVec)){ newVec = vec2MatFormxMatrix(Chol, newVec) } Chol@free=newVec