[Rd] call / do.call expression too big

From: Jeroen Ooms <jeroenooms_at_gmail.com>
Date: Sat, 04 Jun 2011 15:49:16 -0700 (PDT)

I am designing a remote procedure protocol for R, which basically performs a do.call on data and arguments supplied by a client. However, I am experiencing unfortunate behavior of the do.call function. The function do.call seems to serialize all objects in the args list, resulting in an enormous expression, that is then in some way or another returned by many functions. A short example:

args <- list(data=cars, formula=dist~speed); do.call("lm",args);

One can see that for this small example, the returned 'call' attribute is already huge. Another example:

eval(call("cor.test", x=rnorm(100), y=rnorm(100)))

I completely understand why this happens, yet I was wondering if there is an alternative to call/do.call that constructs the call in an different way so that the actual call object is somewhat more compact and does not contain all the data that was involved in the function. For example one that attaches the args list in an environment and constructs a call that refers to these objects or something similar.

View this message in context: http://r.789695.n4.nabble.com/call-do-call-expression-too-big-tp3574335p3574335.html
Sent from the R devel mailing list archive at Nabble.com.

R-devel_at_r-project.org mailing list
Received on Sat 04 Jun 2011 - 22:52:08 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 05 Jun 2011 - 14:10:16 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive