Displaying 1 result from an estimated 1 matches for "body2expr".
2011 May 02
1
Capturing the expression representing the body of a function
Hi all,
What's the preferred way of capturing the expression representing the
contents of a function?
* body(write.csv) gives me a braced expression
* body(write.csv)[-1] gives me a mangled call
* as.list(body(write.csv)[-1]) gives me a list of calls
* as.expression(as.list(body(write.csv)[-1])) is what I want but seems
like too much work
Any suggestions?
Thanks,
Hadley
--
Assistant