Hi everybody,

how is it possible to refer to an argument passed to a function in the 
function call? What I like to do, is something like

f <- function(x,y) x+y
f(2, x) # should give 4

The problem is of course that x is only known inside the function. Of course I 
could specify something like

f(z<-2,z)

but I'm just curious whether it is possible to use a fancy combination of 
eval, substitute or quote ;)

BR, thorn

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to