code: String executeScript(String script, String outputPathname) {
      // Workaround: script contains the absolute output pathname in case outputPathname is not null
      // Replace the absolute output pathname with a relative filename such that OpenCPU can handle
      // the script.
      String scriptOutputFilename;
      if (outputPathname != null) {
        scriptOutputFilename = generateRandomString();
        script = script.replace(outputPathname, scriptOutputFilename);
      } else {
        scriptOutputFilename = null;
      }
  
      try {
        // execute script and use session key to retrieve script response
        String openCpuSessionKey = executeScriptExecuteRequest(script);
        return executeScriptGetResponseRequest(
            openCpuSessionKey, scriptOutputFilename, outputPathname);
      } catch (IOException e) {
        throw new UncheckedIOException(e);
      }
    }
docs: Execute R script and parse response: - write the response to outputPathname if outputPathname
  is not null - else return the response
  
  @param script R script to execute
  @param outputPathname optional output pathname for output file
  @return response value or null in outputPathname is not null