[Rd] weird breaks in hist (PR#2431)
Wed Jan 8 14:45:04 2003
I am baffled as to why you think there is a bug in R here!
On Wed, 8 Jan 2003 email@example.com wrote:
> Full_Name: Reinhold Koch
> Version: 1.6.1
> OS: redhat 8.0
> Submission from: (NULL) (22.214.171.124)
> I came across rather weird behavior of the breaks in hist:
> gives the expected result, besides an unnecessary gap between 2nd and 3rd
It gives the expected result, period. There is no gap, but there is a bin
with count zero.
> always merges up the first two columns,
Why is that wierd? You requested three bins and that's what you got.
(If you didn't know you had done that, please read the help page.)
> also if I resort to
> hist.default(1:4,breaks=1:4). hist.default(1:4, include.lowest=F) gives an
> Error in hist.default(1:4, include.lowest = F) :
> some `x' not counted; maybe `breaks' do not span range of `x'
Why do you even mention that? It's correct! The breaks chosen are
to cover a prettified range of x. You explicitly asked for left-open
intervals, so you got
(1,2], (2,3], (3,4]
and those do not cover the data.
Perhaps as idiot-proofing, include.lowest should not be allowed unless
`breaks' is a sequence of breakpoints.
Brian D. Ripley, firstname.lastname@example.org
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 272866 (PA)
Oxford OX1 3TG, UK Fax: +44 1865 272595