[R] histogram

Henrique Dallazuanna wwwhsd at gmail.com
Thu Oct 8 21:58:02 CEST 2009


Change the breaks argument:

t1 <- hist(1:5, 0:5)
t1$counts

On Thu, Oct 8, 2009 at 4:47 PM, Khanh Nguyen <knguyen at 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 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.
>



-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O




More information about the R-help mailing list