[R] Error:length of dimnames [2] not equal to array extent ?

From: Robin Gruna <robin_gruna_at_hotmail.com>
Date: Sat 03 Jul 2004 - 00:38:45 EST


Hi everyone,
I have the following problem:
I want to perform a LDA with the function lda(). My data object mat.data is a matrix with dimensions

> dim(mat.data)
[1] 1228 44

and my grouping vector grp has length 1228:

> length(grp)

[1] 1228

Every time I call lda(), the following error message occurs:

> lda(mat.data,grp)
Error in lda.default(x, grouping, ...) : length of dimnames [2] not equal to array extent

In order to find the error I created a matrix mat.test

mat.test<-matrix(1:500,nrow=1228,ncol=44)

with arbitrary entries an the same attributes as mat.data:

> dimnames(mat.test)

NULL
> dimnames(mat.data)

NULL But with the test object mat.test there occurs no error ! Can somebody help me, this really makes me crazy, thanks,
Robin



R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Sat Jul 03 00:42:31 2004

This archive was generated by hypermail 2.1.8 : Wed 03 Nov 2004 - 22:54:39 EST