For simply counting frequency of discrete data, table , xtabs, and ftable will work.
> -----Original Message----- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Khanh Nguyen > Sent: Thursday, October 08, 2009 2:47 PM > To: r-help@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@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. ______________________________________________ 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.