public class RScriptExecutor extends Object
Modifier and Type | Field and Description |
---|---|
static String |
RSCRIPT_BINARY
The Rscript binary used to execute the .R scripts.
|
static long |
SCRIPT_TIMEOUT_MS
Maximum runtime of the Rscript process in milliseconds before failing and
throwing an exception.
|
Constructor and Description |
---|
RScriptExecutor() |
Modifier and Type | Method and Description |
---|---|
RScriptOutput |
exec(String script,
RScriptInput input)
Executes by given script by:
- Searching both the classpath and the filesystem for the path
- Copying the script at the given path to a temporary file and
performing variable substitution with the arguments using Freemarker.
|
protected static com.google.common.collect.ImmutableTable<Long,String,Double> |
fromCsv(String csv)
Convert the CSV string to an immutable table.
|
protected static StringBuilder |
toCsv(com.google.common.collect.RowSortedTable<Long,String,Double> table)
Convert the table to a CSV string.
|
public static final String RSCRIPT_BINARY
public static final long SCRIPT_TIMEOUT_MS
public RScriptOutput exec(String script, RScriptInput input) throws RScriptException
RScriptException
protected static com.google.common.collect.ImmutableTable<Long,String,Double> fromCsv(String csv) throws IOException
IOException
protected static StringBuilder toCsv(com.google.common.collect.RowSortedTable<Long,String,Double> table) throws IOException
IOException
Copyright © 2021. All rights reserved.