[R] formals or args question
BJ
erithid at bellsouth.net
Mon May 23 16:45:38 CEST 2005
Hello again, thank you again for all of your help. I am trying to get
the arguments for a function, in a way that I can handle them. If I do
args(fun), it doesnt really do what I want. If I use formals(fun) i get
output like:
$a
$r
$s
Now, lthis is supposedly a list, but if i say formals(a)[[1]], I get
nothing. I am just trying to get a vector with teh arguments of a
function so I can loop over them.
ex; a<-function(p,r){p+r}
want: vector of c("p", "r")
The documentation for args and formals is quite confusing. Thanks again!
~Erithid
More information about the R-help
mailing list