Re: [R] sample function

From: David Scott <d.scott_at_auckland.ac.nz>
Date: Fri 11 Mar 2005 - 14:17:49 EST

On Thu, 10 Mar 2005, Martin C. Martin wrote:

> "hist" is lumping things together.
>
> Try:
> sum(temp == 0)
>
> compare to the height of the left most bar.
>
> Is this a bug in hist?
>
No, hist is the wrong thing to use to display this data.

Try

temp <-sample(0:12, 2000, replace=T,prob=(rep(1/13,13))) barplot(table(temp))

David Scott


David Scott	Department of Statistics, Tamaki Campus
 		The University of Auckland, PB 92019
 		Auckland	NEW ZEALAND
Phone: +64 9 373 7599 ext 86830		Fax: +64 9 373 7000
Email:	d.scott@auckland.ac.nz


Graduate Officer, Department of Statistics



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 Mon Mar 14 10:34:00 2005

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