[Rd] converting body of a function to a a character vector

Erich Neuwirth erich.neuwirth@univie.ac.at
Tue, 17 Apr 2001 12:24:41 +0200


have a look at the following session:

> fff<-function(x)
+ {
+ x*x
+ }
> fff
function(x)
{
x*x
}
>
> body(fff)
{
    x * x
}
> as.character(body(fff))
[1] "{"     "x * x"

somehow,
the closing parenthesis gets lost in the conversion.

i need this stuff because i want to get
the code of a function as a vector of strings so i can get it
into excel with my interface package.



--
Erich Neuwirth, Computer Supported Didactics Working Group
Visit our SunSITE at http://sunsite.univie.ac.at
Phone: +43-1-4277-38624 Fax: +43-1-4277-9386
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._