> -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > On Behalf Of Jenny Barnes > Sent: Wednesday, June 06, 2007 7:55 AM > To: [email protected] > Subject: Re: [R] random numbers selection - simple example > > You're all stars - thanks for the replies - I will go ahead and use > sample........... > I need to do this about 10,000 times - any suggestions for this or simply put > it > in a loop 10,000 times outputting each time to an array? > > Best Wishes, > > Jenny > > > > > > > > use sample(c(0:42), 15, replace=T) > > > >hope it helps, > >kevin
You could try something like the following s<-matrix(sample(c(0:42), 10000*15, replace=TRUE), 10000, 15) which will give you a 10000 row matrix with 1 sample of size 15 per row. Hope this is helpful, Dan Daniel Nordlund Bothell, WA USA ______________________________________________ [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.
