From p.dalgaard@biostat.ku.dk  Fri Jan 31 18:33:02 2003
From: p.dalgaard@biostat.ku.dk (Peter Dalgaard BSA)
Date: Fri Jan 31 18:33:02 2003
Subject: [Rd] hist (PR#2512)
In-Reply-To: <200301311720.SAA00284@pubhealth.ku.dk>
References: <200301311720.SAA00284@pubhealth.ku.dk>
Message-ID: <x2u1fp8bvz.fsf@biostat.ku.dk>

surko@salk.edu writes:

> 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.
> 
> Thanks!
> Pam Surko

As documented (notice the include.lowest argument), so not a bug. Also S-PLUS
compatible.

Histogramming of integers has these pitfalls. For an alternative, you
might want to look up truehist() in the MASS package.

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907



[Rd] hist (PR#2512)
Peter Dalgaard BSA