[Rd] bug in histogram rendering (PR#1080)

ripley@stats.ox.ac.uk ripley@stats.ox.ac.uk
Thu, 30 Aug 2001 07:56:41 +0200 (MET DST)

On Thu, 30 Aug 2001 ljlehou@sandia.gov wrote:

> Full_Name: Leslea J. Lehoucq
> Version: 1.3.0
> OS: Solaris 7
> Submission from: (NULL) (
> When one creates a histogram with the freq=FALSE (i.e. plot
> the density on the Y-axis), the density values are off by a
> factor of 10.  For instance, a bin in which 50% of the plotted
> values fall is marked 0.05, not 0.50, on the Y-axis.  Instead
> of the density summing to 1.0, it sums to 0.1.

It should integrate to one, not sum to one.
Can you give us an example of what you think is wrong?
For example,

Y <- runif(100)
hist(Y, freq=F)

correctly has an average level of 1, sum 5.

Calling them `relative frequencies' is perhaps misleading (relative to
what?), but then what hist() does by default is not a histogram in the
terminology in use in much of the world.  Some of also argue it is
extremely misleading unless the bins are all of the same width.

Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch