j***3 发帖数: 142 | 1 When plotting histogram in R, how exactly R is using breaks? can someone
help me if I understand correctly?
e.g.
breaks=c(0,1,2,3)
default is right= TURE, means the following three bins:
(0,1],(1,2],(2,3]
or
???
so if the entries is 0, they will not be counted?
if I want to include the 0 class in the first bin, I use right= FALSE, but
then the 3 is not included?
is there some way I can set a bin as just one point, e.g. 0 ?
thanks! | z**k 发帖数: 378 | 2 the range of breaks has to cover all x. As for your case, I guess R just use
[0,1] (1,2], (2,3] ... | D******n 发帖数: 2836 | 3 use cut or breaks=c(-0.1,2,3)
【在 j***3 的大作中提到】 : When plotting histogram in R, how exactly R is using breaks? can someone : help me if I understand correctly? : e.g. : breaks=c(0,1,2,3) : default is right= TURE, means the following three bins: : (0,1],(1,2],(2,3] : or : ??? : so if the entries is 0, they will not be counted? : if I want to include the 0 class in the first bin, I use right= FALSE, but
| j***3 发帖数: 142 | 4 thanks zerk,
thank you DaShagen, I think using -0.0x is a solution here, I just wondering
if you can define a bin as just one point rather than a range. | j***3 发帖数: 142 | 5 thanks zerk,
thank you DaShagen, I think using -0.0x is a solution here, I just wondering
if you can define a bin as just one point rather than a range. |
|