I need to run the same R script over and over with different parameters for each run. I've written the R portion and it works. I'm trying to integrate this process with some other Java tools I've written that will need to use on the files changed by the R script. I'm therefore trying to run my R file from Java. I've tried to run it using the command line prompt: RScript TestR.R (this command works in terminal), but that didn't work. I am therefore in the process of trying to run my R script from a bash file. I am using the same command as above and my bash file can execute other commands but for some reason nothing happens when I try to run the R file. The java command I'm using is
Process proc = Runtime.getRuntime().exec("absolute-path/testbash.sh");
I'm not sure what format of output to look for. Currently, this runs without any runtime errors.
UPDATE: when I checked the ErrorStream, it said "Rscript: command not found"
UPDATE: I figured it out by using "/usr/local/bin/RScript"
as the command