[R] embedding R?

M. Edward Borasky znmeb at aracnet.com
Sun Feb 11 20:29:31 CET 2001


> Background: I am a long time user of SPlus, and a recent user of R.  My
> work normally involves converting the raw output of something interesting
> into data to be analyzed in S/R, for which I use Perl extensively.  I then
> import the data into S/R, perform the analyses I need, dumping the values
> into a new file, further Perl processing, eventual database storage.

I have a similar modus operandi: I collect data with Perl, usually resulting
in either comma-separated value (.csv) or tab-separated value (.tab, .dat,
.txt or .tsv) format. Then, for *manual* analysis, I import the data into
either Excel, Minitab, or R directly, or, for larger data sets, import the
data into Microsoft Access and process in Excel or Minitab using ODBC
queries. In the near future I'll add "R-ODBC" to this collection of tools.

My outputs tend to be pictures rather than large amounts of processed data,
however, so mostly I'm interested in graphs that I can import into a Word
document which is the final report. I've made some attempts at automating
all of this, but there is a UNIX/Windows "seam" involved. It would be a big
help in some cases if UNIX "R" could act as an ODBC *server*; I can't use
the obvious choice, "mySQL", because of license restrictions.

The other thing I've done fairly recently in the *automated* analysis is
create the "R" code that does the plotting on the fly in the Perl script,
then execute the code with a Perl 'system' statement. I'm looking for a way
to make the "R" code *constant*, and pass such parameters as input and
output file names, variable names and graph labels to the "R" code, rather
than having the Perl code write an "R" code file for each graph I want to
plot. I think there's a way to do this with environment variables, but I
haven't dug into how "R" deals with environment variables yet. More elegant
would be the capability of passing parameters to the "R" command line just
like you pass parameters to any other UNIX or Windows command line.
--
Ed Borasky
http://www.aracnet.com/~znmeb
mailto:znmeb at aracnet.com

Q: What phrase will you never hear Candice Bergen use?
A: "My daddy didn't raise no dummies".

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list