Skip to content

Generating random integers

4 messages · skayis selcuk, Daniel Nordlund, jim holtman +1 more

#
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/
#
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:

  
    
#
On Sun, Apr 12, 2009 at 1:21 PM, jim holtman <jholtman at gmail.com> wrote:
Another way:

sample(1:100,1000,replace=T)

Paul