I have a java program that calls a R script. Here is the command:
String filename = "hierarchicalClusteringScript.R";
String[] cmd=new String[]{this.conn.getRPath(),"CMD","BATCH",
"--args LD_matrix='"+LD_matrix+"' " +
"image_filename='"+image_filename+"' " +
"width="+300+" "+
"height="+height+" "+
"ordered_snps_filename='"+ordered_snps_filename+"'",
filename,
this.conn.getWorkingDir()+this.conn.getProjectName()+"Routput.txt"};
Runtime runtime = Runtime.getRuntime();
try {
Process process = runtime.exec(cmd);
process.waitFor();
} catch (IOException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
I would like to include the R script "hierarchicalClusteringScript.R" into the jar file. In case I do is there a way to call the script from code? Which path should I use?
Thanks a lot in advance