Message-ID: <x2u1fp8bvz.fsf@biostat.ku.dk>
Date: 2003-01-31T18:33:02Z
From: Peter Dalgaard
Subject: hist (PR#2512)
In-Reply-To: <200301311720.SAA00284@pubhealth.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