[R] someProblem in R-1.4.1

vito muggeo vito.muggeo at giustizia.it
Wed May 22 11:44:51 CEST 2002


Hi all,
This seems a very strange problem, but I'm running R-1.4.1 so, probably it
has been solved in the 1.5.0 version (unfortunatly I can  neither download
the new version nor see the archive).

Assignement of column names in a matrix, works just after editing it:

> M<-matrix(0,10,5)
> dimnames(M)[[2]]<-c("a","m","m","m","m") #say
Error: more elements supplied than there are to replace
> fix(M)
> dimnames(M)[[2]]<-c("a","m","m","m","m") #works

Furthermore the following problem also seems related:
nr<-20
M<-matrix(0,nr,5)
for(i in 1:nr){
            ........some functions.........
            M[i,]<-c(....) #5-dimensional vector
}
It works until to i=10 and then the following message appears:
Error in "[<-"(*tmp*, i, , value =c(......., :
            number of items to replace is not a multiple of replacement
length

This sound me very strange, because if some errors there are, it should not
work also for i<=10.
The loop perfectly works with nr=10 , but it doesn't so for nr=15, 30, for
instance.

Many thanks for your help
best,
vito


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list