From p.dalgaard@biostat.ku.dk  Wed Oct 11 10:45:12 2000
From: p.dalgaard@biostat.ku.dk (Peter Dalgaard BSA)
Date: 11 Oct 2000 11:45:12 +0200
Subject: [Rd] Bug? (PR#690)
In-Reply-To: td2mafea@uco.es's message of "Wed, 11 Oct 2000 11:27:59 +0200 (MET DST)"
References: <200010110927.LAA18569@pubhealth.ku.dk>
Message-ID: <x2pul790ev.fsf@blueberry.kubism.ku.dk>

td2mafea@uco.es writes:

> I dont know if it is a bug, but what's wrong in the folloing (R version
> 1.1.1, August 15, 2000, under windows 98):
> > x<-matrix(nrow=10, ncol=2)
> > for (i in 1:10)
> + {
> + x[i][1]<-i
> + x[i][2]<-i^2
> + }
> Warning messages:
> 1: number of items to replace is not a multiple of replacement length
> 2: number of items to replace is not a multiple of replacement length

Not a bug. You mean x[i,1] etc. Notice that single-indexing a matrix
ignores dimensions:

> x<-matrix(1:20,nrow=10, ncol=2)
> x[1]
[1] 1
> x[12]
[1] 12


-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel 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-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


[Rd] Bug? (PR#690)
Peter Dalgaard BSA