[R] histogram

Rolf Turner r.turner at auckland.ac.nz
Thu Oct 8 22:02:54 CEST 2009


On 9/10/2009, at 8:47 AM, Khanh Nguyen wrote:

> Hi all,
>
> I have a question about hist()
>
> 1)
>> t1 <- hist(c(1,2,3,4,5))
>> t1
> $breaks
> [1] 1 2 3 4 5
>
> $counts
> [1] 2 1 1 1
>
> why is there 2 counts for 1?

	RTFM --- include.lowest = TRUE and right = TRUE by default.

>  And should the counts be '1 1 1 1 1' ?

	No. Not unless you specify different breaks.

> Is there any other function to count frequency of discrete data?

	table()

		cheers,

			Rolf Turner

######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}




More information about the R-help mailing list