[R] random numbers between 0 and 1

Gábor Csárdi csardi at rmki.kfki.hu
Wed Oct 21 21:37:31 CEST 2009


I would suggest to use the generator at
http://submoon.freeshell.org/pix/valium/dilbert_rng.jpg
and subtract 8.5.

Best,
Gabor


On Wed, Oct 21, 2009 at 9:25 PM, carol white <wht_crl at yahoo.com> wrote:
> Hi,
> To generate random numbers between 0 and 1, do you use rnorm followed by dnrom? for ex, for 10 variables
>
> a = rnorm(10)
>> a
>  [1] -0.87640764 -0.95842391 -1.33434559 -0.63844932 -1.69829393  0.80010865
>  [7] -0.01026882 -0.23887516  2.29912600 -1.38352143
>> dnorm(a)
>  [1] 0.27171985 0.25202507 0.16378878 0.32538464 0.09432211 0.28966637
>  [7] 0.39892125 0.38772103 0.02838403 0.15320103
>
>
> Regards,
>
> ______________________________________________
> 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.
>



-- 
Gabor Csardi <Gabor.Csardi at unil.ch>     UNIL DGM




More information about the R-help mailing list