Skip to content
Prev 298739 / 398498 Next

incorrect number of subscripts on matrix

andre bedon wrote
If I run your example as given I get a different error message:

Error: unexpected 'for' in "x.3<-matrix(rep(0,3000),nrow=1000,byrow=T)for"

How about doing

x<-matrix(rep(0,3000),nrow=1000,byrow=T);for(i in
1:1000){x[i,]<-rexp(3,rate=2/3)}

so that x is a matrix.

Berend


--
View this message in context: http://r.789695.n4.nabble.com/incorrect-number-of-subscripts-on-matrix-tp4634953p4634957.html
Sent from the R help mailing list archive at Nabble.com.