The basic set-up is to have a Java based UI and R running in the background. Rserve utility helps to address this kind of a situation.
It's known that Rserve, although not a package, but can be installed and run like a normal R package. A simple library(Rserve)
will invoke it and in the Windows Task Manager, you see the process up and running.
However, there is another way around, without having to go to R console frequently, by writting a script in Java itself.
/**
* initiate R serve
*/
try {
Process p=Runtime.getRuntime().exec("R CMD Rserve --vanilla"); //I'm stuck here
p.waitFor();
} catch (IOException e1) {
e1.printStackTrace();
} catch (InterruptedException e2) {
e2.printStackTrace();
}
The problem is, R CMD Rserve --vanilla
is not working. It says,
`Rserve` is not recognised as internal or external command.
My R CMD is perfect, R is working good, so is Rscript but not Rserve. I wish to know how do I set the appropriate directory/path for Rserve within the R installation, so that I resolve this error?