From erich.neuwirth@univie.ac.at  Tue Apr 17 11:24:41 2001
From: erich.neuwirth@univie.ac.at (Erich Neuwirth)
Date: Tue, 17 Apr 2001 12:24:41 +0200
Subject: [Rd] converting body of a function to a a character vector
References: <200104170617.IAA20047@pubhealth.ku.dk>
Message-ID: <3ADC19E9.AE9E3501@univie.ac.at>

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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


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