Displaying 1 result from an estimated 1 matches for "tp4634953p4634957".
2012 Jun 30
2
incorrect number of subscripts on matrix
Hi,
Wondering if anyone could help me out with this error.Im trying to fill a matrix with random numbers taken from an exponential distribution using a loop:
x.3<-matrix(rep(0,3000),nrow=1000,byrow=T)for(i in 1:1000){x[i,]<-rexp(3,rate=2/3)}
I get the error message:
Error in x[i, ] <- rexp(3, rate = 2/3) : incorrect number of subscripts on matrix
Any ideas??? Appreciate any thoughts.