Skip to content
Prev 170015 / 398506 Next

Generating Numbers With Certain Distribution in R

Gundala Viswanath <gundalav <at> gmail.com> writes:
Technically speaking, I don't think this is possible
since lognormal variates range from 0 to infinity
and are continuous.  However, perhaps something like

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

  That probably doesn't do exactly what you want,
but you will probably need to specify your problem more
precisely (and perhaps give some context) if you want
a better answer ...

  Ben Bolker