I want to run a function in a loop and replace one of the arguments from
a large list each time through the loop. If I was writing it out
manually:

myfunc(x=var1)
myfunc(x=var2)
etc.

But I want to do this in a loop where x is replaced by a new name. 

Something like:

for(i in vars) { myfunc(x=i) }

where "vars" is a vector of names for items in a data.frame.

If I use "as.symbol" to create names, the evaluation never works
correctly. Is there a way to do this? Any suggestions would be
appreciated.

Rick B.

______________________________________________
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