Thanks a lot everyone. You've been a great help!
--
View this message in context:
http://www.nabble.com/Choosing-a-random-number-between-x-and-y-tp21914106p21930844.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org
On Mon, 2009-02-09 at 06:40 -0800, Vie 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 fun
Hi Vie,
Something like the following should be fine:
## R Start...
> n<-1
> my.min <- 0
> my.max <- 0.7
> runif(n, my.min, my.max)
[1] 0.01145260
## R end.
see ?runif for details. Hope that helps a little,
Tony Breyal
On 9 Feb, 14:40, Vie wrote:
> Hi,
>
> Ive been trying to find a function tha
t; To: r-help@r-project.org
> Subject: [R] Choosing a random number between x and y
>
>
> 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 examp
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 wrote:
>
> Hi,
>
> Ive been trying to find a function that will allow me to pull out a number
> between a minimum and maximum threshold.
>
on 02/09/2009 08:40 AM Vie 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 w
Vie bham.ac.uk> writes:
>
> 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 t
random number between x and y
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
See ?runif
> -Original Message-
> From: r-help-boun...@r-project.org
> [mailto:r-help-boun...@r-project.org] On Behalf Of Vie
> Sent: Monday, February 09, 2009 9:41 AM
> To: r-help@r-project.org
> Subject: [R] Choosing a random number between x and y
>
>
>
ilto:r-help-boun...@r-
> project.org] On Behalf Of Vie
> Sent: Monday, February 09, 2009 7:41 AM
> To: r-help@r-project.org
> Subject: [R] Choosing a random number between x and y
>
>
> Hi,
>
> Ive been trying to find a function that will allow me to pull out a
> nu
Vie 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'm no R expert, but this should give you n uniformly distributed
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
12 matches
Mail list logo