Hello, i'm looking for the procedure to generate a random number between 0-1. Try rnorm() but can't get to do generate between 0-1 thanks(i'm sur it's easy) -- Nicolas Baurin Doctorant Institut de Chimie Organique et Analytique, UPRES-A 6005 Universit? d'Orl?ans, BP 6759 45067 ORLEANS Cedex 2, France Tel: (33+) 2 38 49 45 77 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> i'm looking for the procedure to generate a random number between 0-1. > Try rnorm() but can't get to do generate between 0-1The distributions restricted to (0, 1) I know of in R are the beta distributions. You have 'rbeta' and 'runif'.> > thanks(i'm sur it's easy) > > -- > Nicolas Baurin > > Doctorant > Institut de Chimie Organique et Analytique, UPRES-A 6005 > Université d'Orléans, BP 6759 > 45067 ORLEANS Cedex 2, France > Tel: (33+) 2 38 49 45 77Göran -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> i'm looking for the procedure to generate a random number between 0-1. > Try rnorm() but can't get to do generate between 0-1Normal distribution between 0 and 1 ????? For uniform distribution e.g.: runif(100, min=0, max=1) Regards, Uwe Ligges -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
There are many ways to do this. rnorm generates random numbers using normal distribution generator. runif generates random numbers using uniform distribution generator, which by default ranges from 0 ~ 1. I believe "runif()" would be the one you want, althought here are many other distribution like binomial and poisson. To use runif, obviously you can read the documentation by typing:> ?runifHowever, it works basically as: runif(n, min=0, max=1) where n is the number of random numbers you want, min=0, max=1 means you want them to be generated through the uniform distribution generator, between 0 and 1 (they are the default). Cheers, Ko-Kang Wang nicolas baurin wrote:> Hello, > > i'm looking for the procedure to generate a random number between 0-1. > Try rnorm() but can't get to do generate between 0-1 > > thanks(i'm sur it's easy) > > -- > Nicolas Baurin > > Doctorant > Institut de Chimie Organique et Analytique, UPRES-A 6005 > Universit? d'Orl?ans, BP 6759 > 45067 ORLEANS Cedex 2, France > Tel: (33+) 2 38 49 45 77 > > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html > Send "info", "help", or "[un]subscribe" > (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
nicolas baurin <nicolas.baurin at univ-orleans.fr> writes:> Hello, > > i'm looking for the procedure to generate a random number between 0-1. > Try rnorm() but can't get to do generate between 0-1 > > thanks(i'm sur it's easy)I think you're looking for runif() -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._