[R] hist() and bar spacing

Jim Lemon jim at bitwrit.com.au
Fri Aug 11 01:26:29 CEST 2006


Amelie LESCROEL wrote:
> ...
> I obtain this kind of histogram (what I actually want), i.e. large bars with
> no space between them
> 
>  ...
> I obtain a strange histogram with the first 2 bars grouped together and then
> thin bars (not occupying the entire bin width) separated by spaces.
> 
> ... 
> 
> I suspect that it’s causing me some troubles to fit my data to a probability
> density function. Using:
> 
Hi Amelie,

Them's the breaks. Try this:

hist(test,breaks=-1:7)

and you should get what you want.

Jim



More information about the R-help mailing list