Skip to content
Prev 1644 / 63435 Next

hist(1) results in a segmentation fault (at least on my machine) (PR#86)

I've fixed hist.default();
the case for  hist(0) and hist(-1)  also needed consideration.

Here is the patch I've committed:

cvs diff -bw -r1.2.2.1 src/library/base/R/hist.R
diff -b -w -r1.2.2.1 -r1.2.2.4
16,18c16,18
<     use.br <- !missing(breaks) && length(breaks) > 1
<     breaks <-
< 	if(use.br) sort(breaks)
---
20,22c20,22
< 	    rx <- range(x)
< 	    pretty (rx + c(0, diff(rx)/1000),
< 		    n = if(missing(breaks)) 1 + log2(n)
---
27d26
< 		    })
28a28
29a30,35
As you may see, I've also changed
from a potentially asymmetric  rx + c(0, dx/1000)
to a symmetric interval	       rx + c(-1,1)/1000 * dx

Hope this okay even so it changes current behavior in some cases.

-------------

Merry Christmas to all!
I'm gone for the next few days..

Martin
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel 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-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Message-ID: <199812231159.MAA20817@sophie.ethz.ch>
In-Reply-To: <199812230905.KAA19545@sophie.ethz.ch> (message from Martin Maechler on Wed, 23 Dec 1998 10:05:35 +0100)