Displaying 1 result from an estimated 1 matches for "argsasname".
2004 Oct 22
4
Evaluate a function for various value of parameters
...f,1:10,5) would return:
5
10
15...
I would like that f could have a variable number of arguments. I have begin
to write a function:
evaluatemyfunction=function(f,...){
b=match.call(expand.dot=F)$...
myg=expand.grid(lapply(b,eval)) #contains all combinations of parameters
for (i in 1:nrow(myg)){
argsasname=paste(paste(names(myg),myg[1,],sep="="),collapse=",")
# ??????
}
}
I have try to construct arguments of the function as character, then parse
and pass it to f but parse doesn't work:
> parse(text=paste(paste(names(myg),myg[i,],sep="="),collapse=","...