WinVector / wrapr

Wrap R for Sweet R Code
https://winvector.github.io/wrapr/
Other
136 stars 11 forks source link

Macros in R, as.call #11

Closed jangorecki closed 4 years ago

jangorecki commented 4 years ago

Macros in R article is a well made analysis. Thank you very much for sharing. As a feedback I would like to note that AFAIK the eval(as.call(c(as.name("fun"), ...))) should be preferred over do.call. Latter one may impose an overhead when constructing arguments for do.call.

JohnMount commented 4 years ago

Interesting. I'll have to educate myself a bit on the distinction before trying to update based on that. Thank you for the note.

JohnMount commented 4 years ago

I've added a link to your note towards the end of the document. Thanks for contributing the point.

jangorecki commented 4 years ago

This can be good intro to the problem https://grokbase.com/t/r/r-devel/11644r9pbm/rd-call-do-call-expression-too-big AFAIU you should avoid providing objects, but try to refer to them by variable names.

nathaneastwood commented 4 years ago

@jangorecki the link no longer works

nathaneastwood commented 4 years ago

I think maybe it's this one: https://r.789695.n4.nabble.com/call-do-call-expression-too-big-td3574335.html

JohnMount commented 4 years ago

I think maybe it's this one: https://r.789695.n4.nabble.com/call-do-call-expression-too-big-td3574335.html

That looks like what I remember being behind the earlier link. Thank you very much.