[R] Arguments of a function

Florent BATY baty at biomserv.univ-lyon1.fr
Fri Aug 2 15:06:14 CEST 2002

Is it possible to call a function having x arguments with vector 
containing the x values of the arguments in it ?
To make myself clearer, I was wandering if from a function f:

    > f
    function(a,b) a+b

and a vector v which the 2 values of the arguments "a" and "b":

    > v
    a b
    1 2
    > names(v)
    [1] "a" "b"

it is possible to call the function f with vector v as the arguments of the function.
If I use f(v) it returns me an error since v was considered as the value of the first argument.

Do you any ideas ??

Florent BATY
Dynamique des Populations Bactériennes
Faculté de Médecine Lyon-Sud
69921 OULLINS, BP 12
tel : +33 (0)4 78 86 31 67
fax : +33 (0)4 78 86 31 49

r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list