R-beta: wish: hist() returning breaks and counts

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Tue Dec 2 11:20:09 CET 1997


Martin Maechler <maechler at stat.math.ethz.ch> writes:

> 
> >>>>> Albrecht Gebhardt <agebhard at zidsrv.sci.uni-klu.ac.at> writes:
> 
>     Albrecht> would it be possible to change the hist() function in future
>     Albrecht> R Versions to accept a "plot=F" parameter (like hist() in S
>     Albrecht> it should return a list with "breaks" and "counts" in this
>     Albrecht> case). This change should be very simple.
> 
> it _was_ simple, and has been in the current sources for a while now.
> You'll see it in version 0.60 which should be released `real soon now'.
> 
> > hist(rnorm(50), plot=F)
> $breaks
> [1] -3 -2 -1  0  1  2  3
> 
> $counts
> [1]  1 11 12 20  5  1

Martin: Wouldn't it be better to return

invisible(list(breaks = breaks, counts = counts))

in the plot=T case? (currently it's  invisible(NULL) )
-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list