[Rd] A "safe" do.call
Martin Maechler
maechler at stat.math.ethz.ch
Wed Jan 30 11:41:55 CET 2008
>>>>> "hw" == hadley wickham <h.wickham at gmail.com>
>>>>> on Tue, 29 Jan 2008 09:26:24 -0600 writes:
>> > Or is this a bug in glm? It certainly seems that the
>> documentation > should mention that ... is passed to
>> glm.control, which only takes > three arguments. I
>> realise that this doesn't come up very often > during an
>> interactive model fitting session, and it is easy to
>> remedy > when it does, but it makes writing robust
>> functions hard when a > function with ... does in fact
>> have a fixed argument list.
>>
>> I think the docmentation has conflated '...' for glm and
>> '...' for weights.
>>
>> My recollection is that this was intentional: at least
>> one core developer used to dislike '...' as it allowed
>> mistyped argument names to be ignored. And he has a good
>> point, IMO.
hw> That seems a perfectly good reason not to use ... - but
hw> if you are going to use ... it seems like you shouldn't
hw> warn on mismatched argument names.
I disagree.
One "famous" example on this was -- in S-plus, early 1990s --
known about S users back then, and it happened here (as well),
not in theory: a scientist who later came for consulting to us
did a logistic regression
mod1 <- glm(y ~ x1 + x2 + ...., .......
data = ....., famliy = binomial)
summary(mod1)
...
and was wondering about the logistic regression coefficients and
their interpretation and more things
until we found out the small typo above
which made glm() compute a ("gaussian") model even though the
user had clearly said he wanted a logistic one.
Can you see the point?
Martin
hw> Maybe I can attack the problem in the opposite direction
hw> - instead of matching the parameters of the function I'm
hw> calling, I'll try and remove the parameters that
hw> probably belong to ggplot.
hw> Hadley
hw> -- http://had.co.nz/
More information about the R-devel
mailing list