[R] help!! Java and R

Cheryl J Fernandes cferna3 at uic.edu
Tue May 9 21:00:27 CEST 2000


Hi
 
 I'm trying to run  the RGui program in WintNT from a Java
application. i;m using runtime.exec()

It opens the program but after that nothing happens. After opening the
program i'm passing some commands to R via java's process
OutputStreamWriter. But it does NOT respond to any of the commands not
even by giving an exception.

Coudl u please let me know if i can pass commandline commands to RGui from
within Java or are there special API's that are available. I know for a
fact taht Java does NOT have API's for R. It does have special interface
API for major applications like C, Excel, MS-Word

Any help would be greatly appreciated.  

Runtime  rt = Runtime.getRuntime();
String strCmdTmp ="";
strCmdTmp =  "Z:\\R\\rw1000\\bin\\Rgui ";

Process jproc=  rt.exec(strCmdTmp);
OutputStreamWriter o = new OutputStreamWriter(jproc.getOutputStream());

o.write("a<-c(4,5)\n");
o.write("mean(a)\n");
o.write("quit(\"no\")\n");
o.flush();

String line=null;

BufferedReader reader = new BufferedReader(new
InputStreamReader(jproc.getInputStream()));
while((line = reader.readLine())!=null)
System.out.println(" The line is:  " +line); 

Thanks in advance
Cheryl  Fernandes


Cheryl Fernandes                 (Home): (312) 432 4396, (630) 834 3796 
1926 W Harrison Street,          (Office): (312) 996 4605        
Medical Center Apartments,
Apt# 1202,
Chicago, IL 60612

email: cferna3 at uic.edu
       cfernand at eecs.uic.edu




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