[Rd] A "safe" do.call

hadley wickham h.wickham at gmail.com
Wed Jan 30 14:48:06 CET 2008


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

The point is that glm shouldn't use ... but should explicitly list all
of the arguments that it takes?  Why does glm need to use ... in your
example?

If you know the set of possible arguments in advance, why not list
them explicitly and document them individually, and not use ... at
all?

Hadley

-- 
http://had.co.nz/



More information about the R-devel mailing list