[R] histogram
Erik Iverson
eiverson at NMDP.ORG
Thu Oct 8 21:52:53 CEST 2009
For simply counting frequency of discrete data, table , xtabs, and ftable will work.
> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
> On Behalf Of Khanh Nguyen
> Sent: Thursday, October 08, 2009 2:47 PM
> To: r-help at r-project.org
> Subject: [R] histogram
>
> 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? And should the counts be '1 1 1 1 1' ?
>
> Is there any other function to count frequency of discrete data?
>
> Thanks.
>
> -k
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at 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.
More information about the R-help
mailing list