Skip to content

Changing "..." inside a function: impossible? desirable?

1 message · Warnes, Gregory R

#
I agree that it would be useful to be able to manipulate the contents of
<...>.   
Perhaps syntax like:

	dots <- dotargs()  # equivalent to dots <- list(...)

	val1 <- dotargs('arg1')

to extract the contents of <...> and

	dotargs('arg1') <- val1

to modifiy the argument 'arg1' would do the trick.  Then one could do things
like


   myplot <- function(x,y, ...) {
 
    plot(0:1, 0:1, type = "n", axes = FALSE)
 
    result <-  <<do stuff with x,y>>
 
    points(result, ...)
	
    dotargs('pch') <- NA

    axis(1, ...)
    axis(2, ...)

    dotargs('lwd') <- dotargs('xaxp') <- dotartgs('yaxp') <- NULL
    title(...)
   }


-Greg
http://stat.ethz.ch/~maechler/
Seminar fuer Statistik, ETH-Zentrum  LEO C16	Leonhardstr. 27
ETH (Federal Inst. Technology)	8092 Zurich	SWITZERLAND
phone: x-41-1-632-3408		fax: ...-1228			<><

______________________________________________
R-devel@stat.math.ethz.ch mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-devel


LEGAL NOTICE\ Unless expressly stated otherwise, this message is ... [[dropped]]