[R] simulated data using empirical distribution

Dieter Menne dieter.menne at menne-biomed.de
Wed Oct 10 16:44:55 CEST 2007


Tom Sgouros <tomfool <at> as220.org> writes:

> What I have is twelve bins of data, and the population
> in each bin.  The top bin is open-ended, and the whole distribution is
> more or less poisson-ish.
> 
> I can think of a couple of ways to fake this ok, but is there a real R
> way to do it?
> 


hist(rpois(100,10)) # to plot
table(rpois(100,10)) # to get the histogram

I only have problem with your "twelve bins of data". If you really mean the
"ish", you could truncate the above to the 12 that you love.

Dieter



More information about the R-help mailing list