Dear all, Thanks so much, the latest version by Gustav work just fine. In the first version, the outcome is more digital than contiguous.
- Gundala Viswanath Jakarta - Indonesia On Wed, Feb 11, 2009 at 10:35 PM, Gustaf Rydevik <gustaf.ryde...@gmail.com> wrote: > On Wed, Feb 11, 2009 at 2:15 PM, Ben Bolker <bol...@ufl.edu> wrote: >> Bernardo Rangel Tura wrote: >> >>> 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? >> >> Yes. > > > No. > Bernardo misplaced the parenthesis around (x-min(x)) > Correct version is: > > x <- rlnorm(1e6,meanlog=1,sdlog=1) ## pick any parameters you like > y <- round((x-min(x))/diff(range(x))*199999+1) > > > /Gustaf > > > -- > Gustaf Rydevik, M.Sci. > tel: +46(0)703 051 451 > address:Essingetorget 40,112 66 Stockholm, SE > skype:gustaf_rydevik > ______________________________________________ R-help@r-project.org 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.