Skip to content

R-alpha: hist()

2 messages · Peter Dalgaard, Thomas Lumley

#
If you try hist(rnorm(100),lwd=2) with a recent snapshot, you get the
exact opposite effect of what was earlier argued to be desirable in
plots: you get fat axes and thin bar outlines. The cause is plain to
see, at the end of 'hist':

        title(main = main, xlab = xlab, ylab = ylab, ...)
        if (axes) {
                axis(1, ...)
                axis(2, ...)
        }
        rect(breaks[-length(breaks)], 0, breaks[-1], counts, 
                col = col, border = border)

The ...'s are doing it, obviously. So the fix would be to remove ...
from axis() and add it to rect().

However, this example is having me worried that it wasn't a good idea
to depart from the S rule of *always* passing graphical parameters to
lower level routines. For instance, I don't think you would want a
font change *not* passed on to title(), would you? Then what *is*
changeable matter in a plot, really?

The thing that I'm afraid of is that it will become a can of worms to
keep track of which parameters are passed on to what routines. Not to
mention the fact that the ... parameter is essentially indivisible: it
is, to say the least, difficult to pass only some of the parameters.

Cc-ed to R-devel. I think we need to discuss this more broadly.
#
model.frame(,data=foo) requires foo to be a data.frame in R-0.50-a4.
Previously, and in S, a list is sufficient.

A fix is to add
        if (!is.data.frame(data) & !is.null(data)) 
                data <- as.data.frame(data)
before the first line of terms.formula




Thomas Lumley
------------------------------------------------------+------
Biostatistics		: "Never attribute to malice what  :
Uni of Washington	:  can be adequately explained by  :
Box 357232		:  incompetence" - Hanlon's Razor  :
Seattle WA 98195-7232	:				   :
------------------------------------------------------------

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