Change the breaks argument: t1 <- hist(1:5, 0:5) t1$counts
On Thu, Oct 8, 2009 at 4:47 PM, Khanh Nguyen <kngu...@cs.umb.edu> 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? 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. > -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40" S 49° 16' 22" O ______________________________________________ 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.