[R] R as server in Windows

Len Thomas len at mcs.st-and.ac.uk
Thu Sep 7 19:32:47 CEST 2000

Hi All,

I'm looking to call R as a server from another program in the Windows 
environment (the other program is written in Visual Basic).  Ideally, I'd 
like to be able to fire up R and then feed it commands one by one (the 
commands will come from the user over a longish period of time, for example 
as the user decides they want a second plot on the basis of a first one, 

In the book "S Programming", Venables and Ripley say (page 234):

"The windows version of R is builte as a DLL with several front ends, 
including the usual GUI and terminal interfaces.  One example front-end gives 
a direct connection to the R command line: the user supplies a function that 
is called to feed R with commands, and another function for R to call to 
"print" the results.  Graphics windows and pagers are launched in the usual 

I have looked through the R documentation, and the archives of R-help and can 
find no mention of this.  Am I missing something (quite likely!)?

Alternatives are:

1. Run R in batch mode (ie RTerm) with the command file containing one 
command each run, saving and loading the relevant objects between each run.  
This seems inefficient as I'd have to run R many times to complete all the 

2. Use the experimental COM interface.  Although promising this seems rather 
unstable, and doesn't yet implement all the functionality of R.

Any thoughts/comments appreciated.

 - Len

Len Thomas (len at mcs.st-and.ac.uk)
Research Unit for Wildlife Population Assessment
Mathematical Institute, University of St Andrews

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