Error: The name....is illegal because it contains multiple '.' characters...

4 replies [Last post]
adstaple's picture
Offline
Joined: 01/06/2010

I am trying the following (see code below) and getting this error:

Error: The name 'mPA', 'mPA', 'mPA', 'mPA', 'mPA', 'mPA', 'mPA', 'mPA', 'mPA', and 'mPA' is illegal because it contains multiple '.' characters in mxMatrix("Full", nrow = 1, ncol = numManifest, values = 0.05, free = TRUE, dimnames = list(NULL, manifests), name = c(rep("mPA", embedD), rep("mPA", embedD)))

What am I missing? As far as I can tell, the names do not have any punctuation symbols in them.
~ Angela

numManifest <- 10
manifests <- c(paste("pos",0:4,sep=""),paste("str",0:4,sep=""))
embedD <- 5

mxMatrix("Full", nrow=1,ncol=numManifest,
values=.05,
free=TRUE,
dimnames = list(NULL,manifests),
name=c(rep("mPA",embedD),rep("mPA",embedD))
)

adstaple's picture
Offline
Joined: 01/06/2010
Ah, never mind. I was

Ah, never mind. I was confusing 'labels' and 'name' in mxMatrix(). Perhaps an error message that indicated the matrix can only be assigned one name would be informative.

adstaple's picture
Offline
Joined: 01/06/2010
correction, the name=

correction, the name= statement should read

name=c(rep("mPA",embedD),rep("mPS",embedD))

full corrected statement

mxMatrix("Full", nrow=1,ncol=numManifest,
values=.05,
free=TRUE,
dimnames = list(NULL,manifests),
name=c(rep("mPA",embedD),rep("mPS",embedD))
)

mspiegel's picture
Offline
Joined: 07/31/2009
Oops. I think you meant to

Oops. I think you meant to type "labels=" instead of "name=". But it looks like we have a bug where mxMatrix() is doing the wrong thing when the length of the 'name' argument is greater than 1. I'll fix that.

adstaple's picture
Offline
Joined: 01/06/2010
Thanks. I think we were

Thanks. I think we were typing at the same time...