From hadley at rice.edu  Mon May  2 21:21:00 2011
From: hadley at rice.edu (Hadley Wickham)
Date: Mon, 2 May 2011 14:21:00 -0500
Subject: [Rd] Capturing the expression representing the body of a function
Message-ID: <BANLkTikv5z7c-mUoNoDDsJA-_aNLWr_f+g@mail.gmail.com>

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 Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/



[Rd] Capturing the expression representing the body of a function
Hadley Wickham