[R] random between two values
shescott at mail.med.upenn.edu
Thu Aug 6 17:45:37 CEST 2009
Or just use runif's built-in bounds:
Department of Microbiology
University of Pennsylvania
402B Johnson Pavilion
3610 Hamilton Walk
Philadelphia, PA 19104-6076
On Thu, Aug 6, 2009 at 11:11 AM, Sarah Goslee<sarah.goslee at gmail.com> wrote:
> That's pretty straightforward to do - here's a simple function. The
> exact behavior
> at the "edges" is left as an exercise. :)
> rbound <- function(rmin, rmax)
> x <- runif(1)
> x <- x * (rmax - rmin) + rmin
> On Thu, Aug 6, 2009 at 11:02 AM, damien landais<damien.landais at tdf.fr> wrote:
>> I would obtain a random value between two (for example between 40.15 and 56.58 I would have only one value).
>> I'm looking for a package/a function which could do this.
>> Could anybody help me please?
>> Damien Landais
> Sarah Goslee
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help