> Message: 6
> Date: Fri, 09 Oct 2009 10:35:51 -0600
> From: Tony Plate <tplate at acm.org>
> Subject: Re: [Rd] weigths in nls (PR#13991)
> To: Stephen.Bond at cibc.com
> Cc: R-bugs at r-project.org, r-devel at stat.math.ethz.ch
> Message-ID: <4ACF6667.4060801 at acm.org>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> This is expected behavior from the way nls() is written. The nls()
> function has a "..." argument, which means that additional
arguments are
> allowed.
>
> Under "Arguments" the docs say:
> |...| Additional optional arguments. None are used at present.
>
>
> As far as I can see in the code, nothing at all is done with the
> additional arguments (consistent with the docs). I guess the
"..."
> argument is there to allow for future development (though I'm not sure
> what is gained by including "..." as a formal argument now, and
not just
> adding it in the future if and when it is needed.)
>
> In general, the use of ... arguments does add flexibility, but it takes
> away some error-checking.
you are completely right: if `...' is not used at the moment (and that's
the situation for quite some years now) and if it does cause pitfalls
for the user like this one (the mistyping of 'weights' is especially
easy), why not remove it? or, for now, add a test to nls right in the
beginning whether `...' is empty or not and, in case it's not empty to
abort, since a non-empty `...' list at the moment is proof of an invalid
(or at least unintended) call of `nls'?
>
> -- Tony Plate
>
> Stephen.Bond at cibc.com wrote:
> > Potential bug:
> >
> > I mistyped weights in the call ('weigths') and it did not
produce any error> > message. The coefs were exactly the same like
without weights, so I was su> > spicious and when weights(nls1) gave NULL,
I saw my typo.
> >
> > Usually the function will say "Unused arguments", which
shows you the error> > , but not nls.
> >
> > Regards
> > Stephen
> >
> > [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > R-devel at r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-devel
> >
> >