Re: [R] sample function

From: Martin C. Martin <martin_at_metahuman.org>
Date: Fri 11 Mar 2005 - 14:05:11 EST

"hist" is lumping things together.

Try:
sum(temp == 0)

compare to the height of the left most bar.

Is this a bug in hist?

mirage sell wrote:

> Hi everyone, I need help.
> I want to have a "uniform" kind distribution. When I used sample
> function I got almost twice many zeros compared to other numbers. What's
> wrong with my command ?
>
> temp <-sample(0:12, 2000, replace=T,prob=(rep(1/13,13)))
> hist(temp)
>
> Thanks in advance,
>
> Taka,
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri Mar 11 14:13:57 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:42 EST