[R] histogram

Ista Zahn istazahn at gmail.com
Thu Oct 8 22:03:33 CEST 2009


Or the right argument:

t1 <- hist(1:5, right=false)
t1[1:2]
$breaks
[1] 1 2 3 4 5

$counts
[1] 1 1 1 2

The issue has to do with what hist() does with the points that fall
right on the break points.

-Ista

On Thu, Oct 8, 2009 at 3:58 PM, Henrique Dallazuanna <wwwhsd at gmail.com> wrote:
> 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
>
> ______________________________________________
> 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.
>



-- 
Ista Zahn
Graduate student
University of Rochester
Department of Clinical and Social Psychology
http://yourpsyche.org




More information about the R-help mailing list