[Rd] hist (PR#2512)

Prof Brian D Ripley ripley@stats.ox.ac.uk
Fri Jan 31 20:40:03 2003


On Fri, 31 Jan 2003, Peter Kleiweg wrote:

> __ aldus surko@salk.edu __
>
> > The command hist(c(2,2,2,4,5,6)) returns a histogram that looks incorrect -- 3 in the bin labeled 2 on the left, but 1 each in the bins labeled 3,4,5 on the left.
>
>
> That looks as it is supposed to look, according to the help
> page. However, if I run this example with include.lowest=FALSE,
> I get an error:
>
>     > hist(c(2,2,2,4,5,6),include.lowest=FALSE)
>     Error in hist.default(c(2, 2, 2, 4, 5, 6), include.lowest = FALSE) :
>         some `x' not counted; maybe `breaks' do not span range of `x'
>
> Similar if I add right=FALSE:
>
>     > hist(c(2,2,2,4,5,6),include.lowest=FALSE,right=FALSE)
>     Error in hist.default(c(2, 2, 2, 4, 5, 6), include.lowest = FALSE, right = FALSE) :
>         some `x' not counted; maybe `breaks' do not span range of `x'
>
>
> Is this supposed to happen?

Yes.

-- 
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