Skip to content
Prev 170043 / 398506 Next

Generating Numbers With Certain Distribution in R

On Wed, 2009-02-11 at 04:07 +0000, Ben Bolker wrote:
Ben,

I think your routine need a little fix

x <- rlnorm(1e6,meanlog=1,sdlog=1) ## pick any parameters you like
y <- round((x-min(x)/diff(range(x)))*199999+1)

What you think?