[R] Choosing a random number between x and y
tony.breyal at googlemail.com
Mon Feb 9 20:17:25 CET 2009
Something like the following should be fine:
## R Start...
> my.min <- 0
> my.max <- 0.7
> runif(n, my.min, my.max)
## R end.
see ?runif for details. Hope that helps a little,
On 9 Feb, 14:40, Vie <wxv... at bham.ac.uk> wrote:
> Ive been trying to find a function that will allow me to pull out a number
> between a minimum and maximum threshold.
> I want a random decimal number between, for example, 0 and 0.5 or 0 and 0.7.
> I've been searching everywhere for a function that will allow me to do this
> in R, but I have yet to be successful. Any help would be much appreciated.
> Thanks in advance
> View this message in context:http://www.nabble.com/Choosing-a-random-number-between-x-and-y-tp2191...
> Sent from the R help mailing list archive at Nabble.com.
> R-h... at r-project.org mailing listhttps://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help