Dear r-expert,
I would like to generate 30 sets of random numbers from uniform distribution
(0,1). Each set of random numbers should have 90 data. Here is my code:
rand.no <- function(n,itr)
{ for (i in 1:itr)
{rand.1 <- runif(n,0,1)
if (i ==1) rand.2 <- rand.1
else rand.2 <- cbind(rand.2,rand.1)
}
rand.2
}
Question: The code is okay is just that it give me 31 sets instead of 30 sets.
Can anybody any adjustment to my code.
Your help is really appreciated.
Thank you.
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.