Hi,

i have a question regarding the as.function functionality.
I need to save multiple functions with adjusted parameters in a list.
The adjusted parameters are changed via variables in a loop.
The problem I'm facing right now is that the functions saved in
the list don't have the values of the parameters but the variable parameter
itself. Is there a way to force a call-by-value instead of a
call-by-address?

Example(not the real function):
tmp <- 4
f <- as.function(alist(y=,x=tmp,y+x)
f(1) > 5
tmp <- 2
f(1) > 3

thanks ahead and sorry if this question has already been asked before.
I could not really grasp the problem to one Subject.

--
View this message in context: 
http://r.789695.n4.nabble.com/as-function-parameters-tp4620390.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
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