[R] recursive do.call
Jeroen Ooms
jeroenooms at gmail.com
Mon Mar 14 04:24:36 CET 2011
I would like to define a recursive equivalent to call or do.call, which takes
a vector of multiple function names and 'chains' them, by greedy matching of
arguments down the chain. For example, I would like to be able to do:
rec.do.call(c("glm","coef","print), list(formula=dist~speed, digits=3,
data=cars));
which would then be equivalent to:
print(coef(glm(formula=dist~speed, data=cars)), digits=3);
I've been playing around with a recursive function with ellipses, but I
can't wrap my head around it.
--
View this message in context: http://r.789695.n4.nabble.com/recursive-do-call-tp3353074p3353074.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list