code: public static Process doInR(String todo, String Rcmd, String rargs/*, StringBuffer out, StringBuffer err*/, boolean redirect) {
          Process p = null;
          try {
              String Rout = new SimpleDateFormat("yyyy-MM-dd_HH-mm-ss").format(Calendar.getInstance().getTime()) + ".Rout";
              String command = Rcmd + " " + rargs + " -e \"" + todo + "\" " + (redirect ? " > " + Rout + (!RserveDaemon.isWindows() ? " 2>&1" : "") : "");
              Log.Out.println("Doing (in R): " + command);
              if (RserveDaemon.isWindows()) {
                  p = Runtime.getRuntime().exec(command);
              } else /* unix startup */ {
                  p = Runtime.getRuntime().exec(new String[]{"/bin/sh", "-c", command});
                  //new File(Rout).deleteOnExit();
              }
          } catch (Exception x) {
              Log.Err.println(x.getMessage());
          }
          return p;
      }
docs: attempt to start Rserve. Note: parameters are <b>not</b> quoted, so avoid
  using any quotes in arguments
  
  @param todo command to execute in R
  @param Rcmd command necessary to start R
  @param rargs arguments are are to be passed to R (e.g. --vanilla -q)
  @param redirect should we redirect output to a file ?
  @return <code>true</code> if Rserve is running or was successfully
  started, <code>false</code> otherwise.