I don´t 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] 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