[R] problem with do.call

Thomas Lumley tlumley at u.washington.edu
Wed Apr 10 18:13:27 CEST 2002


On 10 Apr 2002, Ernesto Jardim wrote:

> Hi
>
> I'm writing a function that uses four parameters (scalars) and I need to
> run it in an iterative process (the parameters vary to find the minimum
> RSS).
>
> I don't want to use loops and so tried the do.call function. However it
> didn't work. My understanding is that the do.call simple runs the
> function replacing the arguments (scalars by vectors), instead of runing
> the function for each set of scalars in the list, what I need.
>
> Can you please tell me if there is another way of doing it whithout
> using the for loop ?

And why wouldn't you want to use the for() loop?  Unless your function is
vectorised you're not going to gain anything by getting rid of the for()
loop.

	-thomas

Thomas Lumley			Asst. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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