You are here

Issue with indexing in MxMatrix

4 posts / 0 new
Last post
dchackett's picture
Offline
Joined: 05/19/2011 - 16:06
Issue with indexing in MxMatrix

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?

mspiegel's picture
Offline
Joined: 07/31/2009 - 15:24
Oops. That's a bug, I'll

Oops. That's a bug, I'll check in a patch to the repository in the few minutes.

mspiegel's picture
Offline
Joined: 07/31/2009 - 15:24
OK I checked in a fix. You

OK I checked in a fix. You can take a look at it here.

dchackett's picture
Offline
Joined: 05/19/2011 - 16:06
Fixed!

Code works fine now, thanks for the quick fix.