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}}

______________________________________________
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.

Reply via email to