Or:
sample(1:10000,100) # to generate 100 random numbers between 1 and 10000
On Wed, Apr 21, 2010 at 10:42 AM, Gustaf Rydevik
<gustaf.rydevik at gmail.com> wrote:> On Wed, Apr 21, 2010 at 4:37 PM, tamas barjak <tamas.barjak at
gmail.com> wrote:
>> Hi all!
>>
>> I would like to generate random numbers between 0 and 1. How can I do
this?
>> I downloaded it single RNG but it generates ones between only 1 and
>> 10000...:(
>>
>> Thank you for the help!
>>
>> Tamas
>>
>
> Hi tamas,
>
> I am not sure what you mean by ?"downloaded".... There is a lot
of
> random number generators built into R.
>
> To generate 10 random numbers between 0 and 1, try
>
> runif(10)
>
> Regards,
> Gustaf
>
>
>
> --
> Gustaf Rydevik, M.Sci.
> tel: +46(0)703 051 451
> address:Essingetorget 40,112 66 Stockholm, SE
> skype:gustaf_rydevik
>
> ______________________________________________
> 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.
>
--
Dimitri Liakhovitski
Ninah.com
Dimitri.Liakhovitski at ninah.com