[R] histogram - freq=FALSE - density computation

Duncan Murdoch murdoch at stats.uwo.ca
Fri Aug 8 01:00:02 CEST 2008


On 07/08/2008 6:55 PM, Jörg Groß wrote:
> Hi,
> 
> I don't understand what
> 
> hist(x, freq=FALSE)
> 
> does.
> 
> 
> At first I thought it would be just the relative frequencies instead  
> of the absolute frequencies,
> by just computing "frequencies / n" in every category.
> 
> But with a small dataset the y-values (densities) don't sum to one.
> 
> Is there a way to get the histogram doing that?
> Or what is the idea of this density-computation?
> 
> 
> I hope the question is not too stupid...

It returns a probability density function, so the result integrates to 
one.  If the bars are chosen at unit spacings it will sum to one.

Duncan Murdoch



More information about the R-help mailing list