[R] R hangs when trying to invoke through java in linux environment

pravesh pravesh at deepvalue.net
Wed Apr 1 14:08:23 CEST 2009


Hello,

I have a .R file which I am trying to invoke via java with command line
parameters. Basically java invokes the command as follows:

<<Path to R binary>> --slave --args <<Path to CSV File>> <<Direcotry path>>
<<Date>> < <<Script path>>

I am using Rutime class of Java to execute this command. 

I have written a test program to do this. This program works well in
windows, generating the .png file. While in linux this leaves the java
console hung i.e. waiting for something.

I had tried to change the --slave arguements to --vanilla in both the
windows and linux version of the program and compared the output. The output
in windows version confirmed that it had completed successfully. While for
the linux version of the program, the last line that was printed was 

"Type 'q()' to quit R.". After this it remained hung. 

My assumption is that after this R tries to read the graph file and outputs
that to the console and this task is failing in linux.  

However if I manually type the same command in the command prompt for linux,
it executes properly, generating the .png file.

Has anyone had similar problems in invoking R via java in linux? 

Any information regarding this issue will be appreciated.
-- 
View this message in context: http://www.nabble.com/R-hangs-when-trying-to-invoke-through-java-in-linux-environment-tp22825081p22825081.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list