Skip to content
Prev 169813 / 398506 Next

Choosing a random number between x and y

on 02/09/2009 08:40 AM Vie wrote:
If the numbers are to be uniformly distributed within the range you
specify, see ?runif:
[1] 0.33273548 0.34751295 0.15387123 0.32831769 0.01863003 0.28881336
 [7] 0.25578130 0.47281504 0.29631693 0.21392932
[1] 0.52535461 0.12373738 0.40943192 0.02131712 0.32761085 0.22612708
 [7] 0.40411518 0.33841189 0.02760388 0.03942751

This would be covered, for example, in An Introduction to R:

http://cran.r-project.org/doc/manuals/R-intro.html#Probability-distributions


HTH,

Marc Schwartz