Dear R users, I need to generate random integer(s) in a range (say that beetween 1 to 100) in R. Any help is deeply appreciated. Kind Regards Seyit Ali ------------------------------------------------------------------------ Dr. Seyit Ali KAYIS Selcuk University, Faculty of Agriculture Kampus/Konya, Turkey s_a_kayis at yahoo.com, s_a_kayis at hotmail.com Tel: +90 332 223 2830 Mobile: +90 535 587 1139 Greetings from Konya, Turkey http://www.ziraat.selcuk.edu.tr/skayis/
> -----Original Message----- > From: r-help-bounces at r-project.org > [mailto:r-help-bounces at r-project.org] On Behalf Of skayis selcuk > Sent: Saturday, April 11, 2009 11:24 PM > To: r-help at r-project.org > Subject: [R] Generating random integers > > > Dear R users, > > I need to generate random integer(s) in a range (say that > beetween 1 to > 100) in R. > > Any help is deeply appreciated. > > Kind Regards > > Seyit Ali >Look at ?sample Hope this is helpful, Dan Daniel Nordlund Bothell, WA USA
floor(runif(1000, 1,101)) On Sun, Apr 12, 2009 at 2:24 AM, skayis selcuk <skayis at selcuk.edu.tr> wrote:> > ? Dear R users, > > ? I need to generate random integer(s) in a range (say that beetween 1 to > ? 100) in R. > > ? Any help is deeply appreciated. > > ? Kind Regards > > ? Seyit Ali > ? ------------------------------------------------------------------------ > ? Dr. Seyit Ali KAYIS > ? Selcuk University, Faculty of Agriculture > ? Kampus/Konya, Turkey > ? s_a_kayis at yahoo.com, s_a_kayis at hotmail.com > ? Tel: +90 332 223 2830 Mobile: +90 535 587 1139 > ? Greetings from Konya, Turkey > ? http://www.ziraat.selcuk.edu.tr/skayis/ > > ______________________________________________ > R-help at r-project.org 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. > >-- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem that you are trying to solve?
On Sun, Apr 12, 2009 at 1:21 PM, jim holtman <jholtman at gmail.com> wrote:> floor(runif(1000, 1,101)) > >> ? I need to generate random integer(s) in a range (say that beetween 1 to >> ? 100) in R.Another way: sample(1:100,1000,replace=T) Paul