public class RScript extends Object
Rscript.
The script should write all generated output (e.g. plots, diagrams, tables) to files in the working directory. The script should not output anything on stdout or stderr. Any output on stdout is treated as warnings, any output on stderr is treated as error messages.
| Modifier and Type | Method and Description |
|---|---|
String |
convertStreamToString(InputStream is) |
Map<String,String> |
getPackageVersions() |
String |
getVersion() |
void |
runRscript(Path workingDir,
String mainScript,
Integer waitMillis)
Run the Rscript executable.
|
public RScript(Path executable)
public String getVersion() throws IOException
IOExceptionpublic Map<String,String> getPackageVersions() throws IOException
IOExceptionpublic void runRscript(Path workingDir, String mainScript, Integer waitMillis) throws IOException, TimeoutException, AbnormalTerminationException
workingDir - Working directory for the Rscript executable. It must contain at least the file specified in the next argument.mainScript - File name for the main script to be executed in the working directory. The directory must contain the specified file name.waitMillis - Time to wait for the process to finish. If null the process will wait without limit.IOException - IO error, e.g. with processing the process' outputTimeoutException - the specified timeout elapsed before the process exitedAbnormalTerminationException - process terminated abnormally. the provided script did not execute successfully.
For exit code and STDERR output see AbnormalTerminationException.public String convertStreamToString(InputStream is) throws IOException
IOExceptionCopyright © 2014–2019 Uniklinik RWTH Aachen. All rights reserved.