Skip to content
Prev 303611 / 398503 Next

dimnames in an array(I'll be grateful if this message will be passed to all list users)

Have you showed us how to reproduce your original problem?
Have you showed us the output of traceback() after encountering
the error?  Have you tried setting options(error=recover) before
encountering the error and then using recover() to look at the dimensions
and dimnames of the array that caused the problem?

This error message
comes from a nested replacement operation.  One such such case is
     mat <- matrix(1:6,nrow=2,ncol=3)
     colnames(mat)[1:2] <- c("V", "R")
where the nested replacement gets expanded into
     tmp <- colnames(mat) # tmp becomes NULL
     tmp[1:2] <- c("V", "R") # tmp becomes c("V","R"), length is 2
     colnames(tmp) <- tmp # error: 2 colnames for 3 columns
(R uses `*tmp*` where I used tmp - the former is for internal use only.)

There are lots of other possibilities, but you need to at least show the
output of traceback() to pin it down.

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com