Skip to content

Use of ellipses ... in argument list of optim(), integrate(), etc.

6 messages · Vincent Goulet, Tony Plate, Brian Ripley +1 more

#
From the NEWS file:

CHANGES IN R VERSION 2.6.0
SIGNIFICANT USER-VISIBLE CHANGES
  o	integrate(), nlm(), nlminb(), optim(), optimize() and uniroot()  
now have '...' much earlier in their argument list. This reduces the  
chances of unintentional partial matching but means that the later  
arguments must be named in full.

---
   Vincent Goulet, Associate Professor
   ?cole d'actuariat
   Universit? Laval, Qu?bec
   Vincent.Goulet at act.ulaval.ca   http://vgoulet.act.ulaval.ca

Le jeu. 13 mars ? 12:05, Ravi Varadhan a ?crit :
#
Thank you, Vince.

Best,
Ravi.

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

Ravi Varadhan, Ph.D.

Assistant Professor, The Center on Aging and Health

Division of Geriatric Medicine and Gerontology 

Johns Hopkins University

Ph: (410) 502-2619

Fax: (410) 614-9625

Email: rvaradhan at jhmi.edu

Webpage:  http://www.jhsph.edu/agingandhealth/People/Faculty/Varadhan.html



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


-----Original Message-----
From: Vincent Goulet [mailto:vincent.goulet at act.ulaval.ca] 
Sent: Thursday, March 13, 2008 1:09 PM
To: Ravi Varadhan
Cc: r-help at r-project.org
Subject: Re: [R] Use of ellipses ... in argument list of optim(),
integrate(), etc.

 From the NEWS file:

CHANGES IN R VERSION 2.6.0
SIGNIFICANT USER-VISIBLE CHANGES
  o	integrate(), nlm(), nlminb(), optim(), optimize() and uniroot()  
now have '...' much earlier in their argument list. This reduces the  
chances of unintentional partial matching but means that the later  
arguments must be named in full.

---
   Vincent Goulet, Associate Professor
   ?cole d'actuariat
   Universit? Laval, Qu?bec
   Vincent.Goulet at act.ulaval.ca   http://vgoulet.act.ulaval.ca

Le jeu. 13 mars ? 12:05, Ravi Varadhan a ?crit :
----------------------------------------------------------------------------
#
Ravi Varadhan wrote:
Putting optim() arguments after the ... disallows the use of abbreviated 
actual arguments for optim().  This is generally a good thing, because 
prior to this change, it was impossible to supply, via the '...' arguments 
of optim(), an argument to fn() whose name was a prefix of one of the 
arguments of optim().  E.g., if your function had a argument named 'm', you 
could not previously supply it via the '...' argument of optim(), because 
if you did something like optim(x, fun, m=240), intending 'm' to be passed 
to 'fun', the 'm' would instead match the 'method' argument of optim().

The cons of the new argument structure are that abbreviations for names of 
arguments of optim() can't be used (a minor and debatable con), and that 
previous code that used abbreviations might break, but it will likely break 
quickly and noisily, so it's not too bad (the only case where it wouldn't 
break is when fn has a '...' argument itself, and it ignores unrecognized 
components, or where the are other argument name collisions).

-- Tony Plate
#
There is an entry in the NEWS file for 2.6.0:

 		CHANGES IN R VERSION 2.6.0


SIGNIFICANT USER-VISIBLE CHANGES

     o	integrate(), nlm(), nlminb(), optim(), optimize() and uniroot()
 	now have '...' much earlier in their argument list.  This
 	reduces the chances of unintentional partial matching but
 	means that the later arguments must be named in full.

and there was a spate of instances of 'unintentional partial matching' at 
the time.

I have have no idea what you mean by 'ellipses or .' -- this is literally 
'...', and ellipses (e.g. Unicode U+226) do not work. From 
http://en.wikipedia.org/wiki/Ellipsis

   Most programming languages other than Perl6 require the ellipsis to be
   written as a series of periods; a single (Unicode) ellipsis character
   cannot be used.

Please use R-devel for questions about the design and development of R 
(see the posting guide).
On Thu, 13 Mar 2008, Ravi Varadhan wrote:

            

  
    
#
Thanks to Tony Plate, Vince Goulet, and Prof. Brian Ripley (I apologize for
not posting this to R-devel).  

It is nice to know that there can be no unintended side-effects of this new
"ellipsical convention", other than the inconvenience of having to provide
complete names of arguments after the ellipsis.

Best,
Ravi.

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

Ravi Varadhan, Ph.D.

Assistant Professor, The Center on Aging and Health

Division of Geriatric Medicine and Gerontology 

Johns Hopkins University

Ph: (410) 502-2619

Fax: (410) 614-9625

Email: rvaradhan at jhmi.edu

Webpage:  http://www.jhsph.edu/agingandhealth/People/Faculty/Varadhan.html

 

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


-----Original Message-----
From: Prof Brian Ripley [mailto:ripley at stats.ox.ac.uk] 
Sent: Thursday, March 13, 2008 2:01 PM
To: Ravi Varadhan
Cc: r-help at r-project.org
Subject: Re: [R] Use of ellipses ... in argument list of optim(),
integrate(), etc.

There is an entry in the NEWS file for 2.6.0:

 		CHANGES IN R VERSION 2.6.0


SIGNIFICANT USER-VISIBLE CHANGES

     o	integrate(), nlm(), nlminb(), optim(), optimize() and uniroot()
 	now have '...' much earlier in their argument list.  This
 	reduces the chances of unintentional partial matching but
 	means that the later arguments must be named in full.

and there was a spate of instances of 'unintentional partial matching' at 
the time.

I have have no idea what you mean by 'ellipses or .' -- this is literally 
'...', and ellipses (e.g. Unicode U+226) do not work. From 
http://en.wikipedia.org/wiki/Ellipsis

   Most programming languages other than Perl6 require the ellipsis to be
   written as a series of periods; a single (Unicode) ellipsis character
   cannot be used.

Please use R-devel for questions about the design and development of R 
(see the posting guide).
On Thu, 13 Mar 2008, Ravi Varadhan wrote:

            
always
main
i.e.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
http://www.R-project.org/posting-guide.html