We spoke about this before, but, as Bill pointed out recently, having blocks of code that cannot be evaluated (and that appears to be ending in commas) is going to be a source of confusion for users. Unless we place those pieces of code in the context of a large function call--by showing that large function call as one unit before the other pieces (and possibly referring to line numbers, which can be turned on)--we should probably just make use of variables in R.
We also have some irregular usage of semicolons in the documentation that needs addressed.
So the Optimization Script demo would be:
myExpMeanMatrix <- mxMatrix( type="Full", nrow=1, ncol=2, free=True, values=c(0,0), dimnames=list(NULL, selVars), name="expMean" )
myCholMatrix <- mxMatrix( type="Full", nrow=2, ncol=2, free=c(T,T,F,T), values=c(1,.2,0,1), dimnames=list(selVars, selVars), name="Chol" )
myExpCovAlg <- mxAlgebra( expression=Chol %*% t(Chol), name="expCov", dimnames=list(selVars, selVars) )
myData <- mxData( observed=testData, type="raw" )
myObj <- mxFIMLObjective( covariance="expCov", means="expMean" )
bivCorModel <- mxModel("bivCor", myExpMeanMatrix, myCholMatrix, myExpCovAlg, myData, myObj)