Published on *OpenMx* (http://openmx.psyc.virginia.edu)

By *dchackett*

Created *05/19/2011 - 15:26*

Thu, 05/19/2011 - 15:26 — dchackett [1]

So, given an mxMatrix, testMatrix, with values:

@values

X Y G

X 1 2 3

Y 4 5 6

Then:

testMatrix[c('X'), c('X', 'G')]

yields:

@values

[,1]

X 1

G 3

The row name has been dropped and the matrix has been transposed. I'm fairly sure this is happening because of R turning the 1xN matrix in to a vector, and then OpenMx turning the vector back in to a matrix. If this is a bug, could someone point me to where the mxMatrix indexing code is, or if it's a feature, tell me what I'm doing wrong?

**Links:**

[1] http://openmx.psyc.virginia.edu/users/dchackett

[2] http://openmx.psyc.virginia.edu/thread/824

[3] http://openmx.psyc.virginia.edu/thread/304

[4] http://openmx.psyc.virginia.edu/forums/openmx-help/openmx-general-help