[Rd] Changing "..." inside a function: impossible? desirable?

Martin Maechler Martin Maechler <maechler@stat.math.ethz.ch>
Wed Dec 18 08:37:03 2002


>>>>> "Luke" == Luke Tierney <luke@stat.uiowa.edu>
>>>>>     on Tue, 17 Dec 2002 15:12:40 -0600 (CST) writes:

    Luke> On Tue, 17 Dec 2002, Martin Maechler wrote:
    >>  It's clear that some things in "..." can be passed to
    >> title() and some to axis(), etc.  Of course the above is
    >> really silly, but I have a situation where I'd like to
    >> see if something, say, `myarg' is part of "..."  {piece
    >> of cake easy, see below} but then I want to *eliminate*
    >> it from "..." such that I can pass "..." down to other
    >> functions which would want to see a `myarg' argument.
    >> 
    >> Something like
    >> 
    >> if("myarg" %in% (naml <- names(list(...)))) { ## ok, it's
    >> there, take it out marg <- list(...)$ marg
    >> 
    >> ## what I now would like is
    >> 
    >> ...  <- unlist( list(...)["myarg" != naml] ) }
    >> 

    Luke> Doesn't

    Luke> function(x, y, myarg, ...) {
    Luke>    if(! missing(myarg)) {
    Luke> 	## ok, it's there, do whatever
    Luke>    }
    Luke>  ....


    Luke> i.e. just remove the things you explicitly want not in ... by naming
    Luke> them as arguments work for your setting?

Sure.  That's the standard approach I have been using many times
in the past (and still!).

For the (many!) graphics parameters, 
this leads to very many new arguments also differing between
context, i.e.  cex.axis, cex.main, ....

Fiddling with "..." could have been a  alternative..
and also a general `language utility', 
Martin