Hi Vie,
Take a look at ?runif.

set.seed(123)
> runif(1,0,0.5)
[1] 0.1437888
> runif(1,0,0.7)
[1] 0.5518136

HTH,

Jorge


On Mon, Feb 9, 2009 at 9:40 AM, Vie <[email protected]> wrote:

>
> Hi,
>
> 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-tp21914106p21914106.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> [email protected] 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.
>

        [[alternative HTML version deleted]]

______________________________________________
[email protected] 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.

Reply via email to